Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smarter color reducer? (considering visual similarity) #100

Closed
chrisyelf opened this issue Jan 3, 2023 · 2 comments
Closed

smarter color reducer? (considering visual similarity) #100

chrisyelf opened this issue Jan 3, 2023 · 2 comments

Comments

@chrisyelf
Copy link

Hello,

Would it be possible to have a smarter color reducer?
Converting the attached png
serbia

pngquant -o serbia_quantized.png 6 serbia.png

results in ~5 colors visually (I'm sure pixels are slightly different):
white, yellow, brown, red, black
serbia_quantized

The blue in crown was converted to brown. Instead, black outlines could be converted to brown (closer visually) and leave blue alone.
If the colors are close visually, I'd prefer to have just one instead of two separate black and dark brown (the one with most pixels).

What do you think?

@kornelski
Copy link
Member

pngquant uses median cut algorithm, which is not optimal for very low numbers of colors. The library is designed for minimum 16, and typically 256 colors. I do not plan to support fewer number of colors, because at that point you can select them by hand.

@chrisyelf
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants