ImageOptim / libimagequant

Palette quantization library that powers pngquant and other PNG optimizers
https://pngquant.org/lib
Other
780 stars 132 forks source link

Has any demo to compress APNG by Libimagequant ? #6

Closed jeakey closed 2 years ago

jeakey commented 7 years ago

Libimagequant can generate a single palette that is optimal for multiple images , but I don't kown how to compress APNG file , has any demo to compress APNG by Libimagequant? thanks~

kornelski commented 7 years ago

Libimagequant, by itself, doesn't support writing of any PNG files whatsoever. It only converts in-memory uncompressed pixels to in-memory uncompressed pixels in a different layout.

Any image format loading or saving (whether PNG, APNG, GIF, BMP, IFF-ILBM or smoke signals) is out of scope and entirely up to you.

So the problem is split in two parts:

  1. Do you know how to use libimagequant to generate palette and remapped pixels?
  2. Do you know how to write an APNG file with any palette and any pixels?

With 1 I can help you. For 2, you need to find a library that can do it.

jeakey commented 7 years ago

Thanks, I think I know how to do it.

mateoconlechuga commented 6 years ago

If you need any more APNG things, we have code to write an APNG file with optimization in addition to a script to build and patch libpng with libpng-apng since it doesn't come standard. Hope this is useful for you!

https://github.com/CE-Programming/CEmu/tree/master/gui/qt/capture