Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Most quantizer algorithms reduce the number of colors in an image, but the colors appear as dots throughout the image. When quantizing images which we know have a fixed number of colors, say, logos, it is desirable that similarly colored pixels are clustered together. Is there a quantizing algorithm that is suitable for this purpose?
Posted

many quantization functions will allow you to control the amount of dithering that occurs once the output palette has been determined. dithering is what gives you the 'dots' - it's an attempt to blend two colors in order to better represent to original image.

if you can turn off dithering, you'll get nice clean edges between areas of solid color.
 
Share this answer
 
Threshold is the obvious dithering technique (or "quantization algorithm") that makes similar sections appear as a solid. If you want to perform a statistical analysis to decided which colors to use beforehand, you could then adjust each pixel according to which of those chosen colors it is closest to. This would give a cartoon look (i.e., looks like cell shading rather than interspersed dots), which I believe is what you are after. Not sure if there is a name for the algorithm which combines closest match and statistical analysis, but if not then just create it and give it any name you like (e.g., Smart Threshold). :)
 
Share this answer
 
Comments
Hiren solanki 1-Sep-10 1:51am    
intresting

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900