#21 PNGCrush alters images that don't use black

None
open
None
5
2013-06-07
2005-12-08
Anonymous
No

If source image is a 8-bit depth palette PNG that only
uses 4 unique colours but does not use black colour,
reducing bit depth to 2 and palette length to 4 colour
via switches "-reduce -brute -rem alla -bit_depth 2
-plte_len 4" causes PNGCrush to turn one colour to
black (see attachment acme). In addition, using
-reduce switch does not reduce output images bit depth
or palette length in such case.

Discussion

  • Nobody/Anonymous

    Sample picture 'acme'

     
  • Glenn Randers-Pehrson

    • assigned_to: Glenn Randers-Pehrson
    • Group: -->
     
  • Glenn Randers-Pehrson

    It is an error to use -plte_len 4 when there is a palette index present in the image with value greater than 4. Currently pngcrush will issue a warning if you try to do that. Pngcrush does not currently have a capability of regenerating the palette. You can use ImageMagick to do that:

    convert acme.png -define png:exclude-chunks=all acme_im.png

    The "-define png:exclude-chunks=all" directive suppresses some extra chunks (bKGD, text, cHRM, gAMA) that ImageMagick would otherwise insert.

     
    Last edit: Glenn Randers-Pehrson 2013-06-07

Log in to post a comment.