Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# All-Topics
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 23-Mar-10 3:14am
Shree1.4K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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). Smile | :)
  Permalink  
Comments
Hiren Solanki at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 205
1 Zoltán Zörgő 200
2 Peter Leow 160
3 BillWoodruff 85
4 CPallini 70
0 Sergey Alexandrovich Kryukov 9,543
1 OriginalGriff 6,901
2 Peter Leow 4,737
3 Zoltán Zörgő 4,404
4 CHill60 2,932


Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 23 Mar 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100