View Single Post
Old 03-22-2011, 09:48 AM   #35
Honf began at the beginning.
Posts: 27
Karma: 18
Join Date: Mar 2011
Device: Kindle
Originally Posted by glennrp View Post
Yeah, if you simply used
pngcrush -plte_len 16 ...
it could generate an invalid PNG. That dangerous option is only for truncating a palette with unused entries at the top. To actually quantize your image down to 16 colors with pngcrush you also need to set the bit-depth to 4, i.e.,
pngcrush -bit_depth 4 -plte_len 16 ..
which simply drops the low 4 bits of each color sample, or you could use another application like ImageMagick or pngquant to get a better-looking quantization. I'll look into making pngcrush give a better error return if valid palette entries are being truncated with the -plte_len option. ../glennrp
-bit_depth 4 -plte_len 16 is the exact setting I used. And it produced horrible images (they opened fine in windows, horrible on kindle). I'll try it out again and I'll open up the commands that pngcrush receives in case anyone will feel adventurous and would like to change them or optimize them.
I'd gladly take better default settings though, if you would find them.
Honf is offline   Reply With Quote