toy / image_optim

Optimize images using multiple utilities
https://github.com/toy/image_optim
MIT License
1.52k stars 109 forks source link

Add number of colors option for pngquant #144

Closed nosideeffects closed 7 years ago

nosideeffects commented 7 years ago

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

toy commented 7 years ago

Do you mean the --posterize flag?

nosideeffects commented 7 years ago

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 7 years ago

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 7 years ago

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

nosideeffects commented 7 years ago

Looks good to me!