Menu

#61 `-bit_depth 8` corrupts output when applied to 16-bit input

None
closed
None
1
2015-08-07
2013-09-26
No

Applying -bit_depth 8 to an 16-bit input PNG might be expected to reduce the color depth (particularly if there are, in fact, fewer than 2^24 unique colors) but it instead appears to change the image header but leave the data unchanged, thus mangling both the colors and the geometry! Please see the example input and output PNGs which I have attached.

If this is not intended to be supported (it would involve a bunch of extra algorithmic goo) pngcrush should error out rather than creating a corrupt output file.

(Originally reported as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546267 )

2 Attachments

Discussion

  • Glenn Randers-Pehrson

    Verified that -bit_depth 8 produces an incorrect image, and -reduce detects that the image is not reducible to 8-bit depth without loss and therefore does not attempt to reduce it.

     
  • Glenn Randers-Pehrson

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

    • status: open --> accepted
     
  • Glenn Randers-Pehrson

    The "-bit_depth N" option was removed from pngcrush-1.7.68 and later.

     
  • Glenn Randers-Pehrson

    closed-fixed.

     
  • Glenn Randers-Pehrson

    • status: accepted --> closed
     

Log in to post a comment.