toy/image_optim

Add number of colors option for pngquant

nosideeffects opened this issue · 5 comments

pngquant allows you to pass in a number of colors to quantize images with a maximum allowed palette size.

toy commented

Do you mean the --posterize flag?

That is different than what I meant, but that would be useful, too.

The command is pngquant [options] [ncolors] -- pngfile. For instance, in my current workflow, I produce many small icons, so it is safe for me to limit the colors to 16. Without the option to specify the colors, I must use pngquant separately before using image_optim.

toy commented

Ah, you are right! I thought that I remembered an option for number of colours, but did not find it in the list of pngquant flags.
Should be easily doable then.

toy commented

@nosideeffects Please have a look at pngquant-max-colors branch

Looks good to me!