kornelski / pngquant

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

Document `--map` argument #411

Open Winterhuman opened 1 year ago

Winterhuman commented 1 year ago

I noticed in some issues and pull requests that there's a --map option available which is "undocumented", however, I couldn't find an explanation for why this is. Is there a chance it could be included in the --help and man pages?

kornelski commented 1 year ago

It reads palette from the given file.

It's undocumented, because of tradition. It was undocumented in 1999 version of pngquant too! ;)

More seriously, I never implemented it properly by reading the palette out of the file, it applies pngquant to it, so it only uses palette for pixels in the file, not all (including unused) palette entries.

Winterhuman commented 1 year ago

Yeah, I noticed using an indexed PNG for the palette image doesn't work (I didn't open an issue for that in case --map was being deprecated, hence this issue), it's cool to hear how long pngquant has been around!

Are there any plans for enhancing --map in the future? Maybe a way to export a palette from an existing image?