[magick-users] Issue with -depth and -colors ?bug?

Mikel Waxler mikel at skywardmobile.com
Tue Dec 11 07:28:30 PST 2007


Thanks for the fast response.

Just to be 100% clear there is no way to specify the minimum or  
maximum colormap size of an palette based png.

I know I can use Optipng or pngnq, but I would like to avoid using a  
second binary.

Thanks again,
-Mikel

Search Tags:
8-bit 4-bit 2-bit 1-bit index indexed

On Dec 11, 2007, at 2:31 AM, Anthony Thyssen wrote:

> Mikel Waxler on  wrote...
> | When I use both -depth and -color in one command the -depth gets
> | ignored and I end up with a 4-bit (or less) colormap on some images.
> | This would be fine except some of the devices I need to read this
> | image fail to decode anything less than 8-bit images.
> |
> | I am getting images from a script that cuts up large images into
> | sections. Some of the sections contains a very small number of
> | colors, perhaps 1. The test image I am using can be found here:
> | http://waxor.com/test.png.
> |
> | What I need is to convert test.png into a png8 with an 8-bit
> | colormap. I can do this by just specifying -depth. I need to specify
> | the number of colors, even if it it larger then the number in this
> | image since some of my images contain more then 256 colors. This is
> | because I need to limit the full size image to say, 70 colors. I
> | would like to do this without using 2 convert calls.
> |
> | //Here are some examples:
> | // This works fine
> | antenna:~ mikel$ convert test.png -depth 8  png8:png8.png; file  
> png8.png
> | png8.png: PNG image data, 213 x 163, 8-bit colormap, non-interlaced
> |
> | //this does not
> | antenna:~ mikel$ convert test.png -depth 8 -colors 70 png8:png8.png;
> | file png8.png
> | png8.png: PNG image data, 213 x 163, 1-bit colormap, non-interlaced
> |
> | // Attempt with 2 calls
> | antenna:~ mikel$ convert test.png -depth 8 -colors 70   
> png8:png8.png;
> | convert png8.png -depth 8 png8-8.png; file png8-8.png
> | png8-8.png: PNG image data, 213 x 163, 1-bit colormap, non- 
> interlaced
> |
> | // 2 calls, reverse order, also fails.
> | antenna:~ mikel$ convert test.png -colors 70  png:png.png; convert
> | png.png -depth 8 png8:png8.png; file png8.png
> | png8.png: PNG image data, 213 x 163, 1-bit colormap, non-interlaced
> |
> | Am I misunderstanding what -depth should do or should I file a  
> bug on
> | he bug list?
> |
> Depth is output color depth, it has nothing to do with color index  
> table
> lengths.
>
> If you want exact PNG file control I suggest you use the specific PNG
> optimizar programs..   OptiPNG and  PNGng
>
>
>   Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
>   
> ---------------------------------------------------------------------- 
> -------
>   The most menacing dwarf battle cry...
>         Today Is A Good Day For Someone Else To Die!
>                                        -- Terry Pratchett - ``Carpe  
> Jugulum''
>   
> ---------------------------------------------------------------------- 
> -------
>      Anthony's Home is his Castle     http://www.cit.gu.edu.au/ 
> ~anthony/
> _______________________________________________
> Magick-users mailing list
> Magick-users at imagemagick.org
> http://studio.imagemagick.org/mailman/listinfo/magick-users



More information about the Magick-users mailing list