Strange "add" behaviour

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

OK... Tomorrow afternoon? ;)

Well, but till then - anybody got an idea how to keep PNG2DDS from popping up all the time?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Strange "add" behaviour

Post by fmw42 »

Langschwert wrote:OK... Tomorrow afternoon? ;)

Well, but till then - anybody got an idea how to keep PNG2DDS from popping up all the time?
You likely will need to ask that of the PNG2DDS developer or some forum about that. But perhaps some IM user may be familiar with that tool and you will get lucky.
mambo4
Posts: 12
Joined: 2013-08-21T15:03:42-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by mambo4 »

There are a few command line tools for dds conversion.

Nvidia has nvconvert, part of Nvidia texture tools https://code.google.com/p/nvidia-texture-tools/
ATI hasTheConversionator ( which i am using) http://developer.amd.com/resources/arch ... /#download
XnConvert is another dds/dxt tool that supports batch commands. http://www.xnview.com/en/xnconvert/

Edited: added links for tools.
Last edited by mambo4 on 2013-08-23T08:48:08-07:00, edited 1 time in total.
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Thanks, I will try to find these. :)
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

I found a different approach using a Dos command I never used before.

Instead of

FOR /F %%I IN ('DIR %zieldir%\*.png /b/s') DO png2dds.exe -c %%~pI%%~nI.png %%~pI

I use

FOR /F %%I IN ('DIR %zieldir%\*.png /b/s') DO start /I /wait /min png2dds.exe -c %%~pI%%~nI.png %%~pI

That way the program is started minimized. Now it still is popping up every two seconds - but just in the task bar not interfering with any other work I do. :)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Strange "add" behaviour

Post by dlemstra »

I just committed my changes to add support for writing dds files. This will be included in the next release of ImageMagick. You can use the following options when writing dds files:
  • dds:compression
    • dxt5 (Write the file in the dxt5 format, this is the default value)
    • dxt1 (Write the file in the dxt1 format, this will be used automatically when the image has no transparency)
    • none (Write the file without compression)
  • dds:cluster-fit
    • true (Use a slow but very high quality compression method)
    • false (Use the range-fit compression method, this is the default)
  • dds:weight-by-alpha
    • true (Weight the colour by alpha during cluster fit)
    • false (This is the default value)
  • dds:mipmaps (This has been changed see below for details)
    • true (Writes mipmaps in the output file, this requires the image width and height to be a power of two)
    • false (Disable writing mipmaps, this will be used when the width and height are not a power of two)

If you want to convert a PNG that has no transparency to a dds file with the best quality you should do this:
convert input.png -define dds:compression=dxt1 -define dds:cluster-fit=true output.dds
Last edited by dlemstra on 2013-09-11T11:11:51-07:00, edited 1 time in total.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Thank youuuuu. Image
mambo4
Posts: 12
Joined: 2013-08-21T15:03:42-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by mambo4 »

nice! 2 questions:

1.) NVIDIA tools include a DXT5n compression setting for compressing normal maps -which is useful as normal maps require careful compression to preserve the normal data.
any such options for imagemagick?

2.) Some utilities allow specifying the number of mip levels.
at my studio, we are limiting the amount of mip maps generated.
Instead of descending by powers of 2 down to a 1x1 map, we are cooking down to Oringinal size and 2 mip levels.
any such options for imagemagick?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Strange "add" behaviour

Post by dlemstra »

1.) I would have to do some research to figure out how that would work. Feel free to contact me to give me some pointers.
2.) This will be added before the next release. I will call this option 'dds:mipmapcount'?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Are you able to estimate a release date for the next version? I am quite interested in the dds-writing capabilities. ;)
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Strange "add" behaviour

Post by dlemstra »

dlemstra wrote:
  • dds:mipmaps
    • true (Writes mipmaps in the output file, this requires the image width and height to be a power of two)
    • false (Disable writing mipmaps, this will be used when the width and height are not a power of two)
dlemstra wrote: 2.) This will be added before the next release. I will call this option 'dds:mipmapcount'?
I decided to just change the dds:mipmaps option. You can use it now to set the number of mipmaps. Setting it to zero will disable writing mipmaps.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Thank you sooooo much für implementing the .DDS writing feature. :)

Now I have another question that is more about syntax.

convert %1 %2 %3 -compose Over -composite %4

Whereas
%1 = original tank skin
%2 = camo Pattern
%3 = template between both
%4 = target file

How do I have to change the command line to make %2 only 80% of density (or 20% transparenty). I´m trying to make the camo pattern a little transparent to have more of the original structure pass through the paint.

Examples:
Original: http://files.homepagemodules.de/b167881 ... 1626n3.png

After processing: http://files.homepagemodules.de/b167881 ... 1626n2.png

...and the camo pattern should be more like 80% (I´m going to experiment a little with the value).
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Strange "add" behaviour

Post by snibgo »

You can adjust the level of %3, for example:

Code: Select all

convert %1 %2 ( %3 +level 0,80% ) -compose Over -composite %4
If in a Windows batch script, double the "%".
snibgo's IM pages: im.snibgo.com
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

Thank you sooooo much - again! Image
Langschwert
Posts: 17
Joined: 2013-08-19T12:04:09-07:00
Authentication code: 6789

Re: Strange "add" behaviour

Post by Langschwert »

It works perfectly - and of course that results in a new problem. Each nation got a different basic color for its tanks. Now it changes the camo colors by abut 20%.
Pics: http://167881.homepagemodules.de/g22-.html

Sooooo, is there a way to greyscale only the area that is beeing procecced by the batch? If I´d greyscale the wohle picture, all wood, rubber and stuff would be greyscaled too.
Since I use a special work directory the procedure does not have to be integrated into the other command line, I can run it on a different occasion before the actual processing.

%1 = original tank skin
%2 = camo Pattern
%3 = template between both
%4 = target file

Man, siss tank skin business is a surprrizingly diffikult one. (German accent included)
Post Reply