JPG is a lossy compression format. Each time you decompress and 
recompress you are doing so likely at different qualities and 
different algorithms. So naturally you will get different numbers of 
colors. I don't think there is a good way to do this with IM and use 
JPEG format.  You can use trial and error with -quality to see if you 
can get nearly the same number of colors, but the colors may not be 
exactly the same, only similar. IM uses a default -quality of 85, if 
it has not estimate from the input jpg.

see

http://www.imagemagick.org/Usage/formats/#jpg
http://www.imagemagick.org/script/command-line-options.php#quality



>Hi there,
>
>I've got a big problem. I'm using convert to store a JPG as JPG and even
>if I do not use any parameters, the amount of colors, reported by
>Identify, varies.
>
>Example:
>A JPG picture, RGB Colorspace (with 8bit depth per channel), round about
>700.000 Colors. After using convert without any parameters, the amount
>of colors in the result file is about 1.500.000.
>
>But what we want, even if JPG probably doesn't support that, is to keep
>the amount of colors and the colors itselfs as close to the original
>amount respectivly as true, as possible.
>
>I'd be very lucky if anyone would have a suggestion for me/us.
>
>Thanks a lot in advance an greetings from
>B. Bartels
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to