kornelski / pngquant

Lossy PNG compressor — pngquant command based on libimagequant library
https://pngquant.org
Other
5.16k stars 480 forks source link

Does pngquant chang some chunk in bytecode of the image to make sure the image has compressed by pngquant #304

Open pan-haos opened 6 years ago

pan-haos commented 6 years ago

I use pngquant to compress the image and read the bytecode of the image. I found that the content of the bytecode has been changed. I want to know if the pngquant compressed image has the same identifier as the zTXt chunk. Do I need to compress the image After adding a chunk to the image to identify the image is compressed with pngquant, to avoid the project repeatedly compressing the same image during the construction process.

kornelski commented 6 years ago

Pngquant doesn't add any extra chunks to identify itself. Images generated by pngquant will be in PNG8 format (8-bit indexed) as opposed to 24 or 32-bit variants. If you only convert 24/32-bit PNG files, and skip 8-bit ones, you will get the desired effect.