Click here to Skip to main content
16,008,010 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: Most common used color in an image? Pin
Russell'10-Sep-07 8:06
Russell'10-Sep-07 8:06 
GeneralRe: Most common used color in an image? Pin
mm-2k10-Sep-07 8:09
mm-2k10-Sep-07 8:09 
GeneralRe: Most common used color in an image? Pin
Russell'10-Sep-07 8:44
Russell'10-Sep-07 8:44 
AnswerRe: Most common used color in an image? Pin
Luc Pattyn10-Sep-07 10:11
sitebuilderLuc Pattyn10-Sep-07 10:11 
GeneralRe: Most common used color in an image? Pin
mm-2k10-Sep-07 10:17
mm-2k10-Sep-07 10:17 
GeneralRe: Most common used color in an image? Pin
Luc Pattyn10-Sep-07 10:52
sitebuilderLuc Pattyn10-Sep-07 10:52 
GeneralRe: Most common used color in an image? Pin
mm-2k10-Sep-07 19:21
mm-2k10-Sep-07 19:21 
AnswerRe: Most common used color in an image? Pin
El Corazon11-Sep-07 3:36
El Corazon11-Sep-07 3:36 
mm-2k wrote:
Is there any way to get the most common used color of an image (jpg) in C#/VB? I have been searching the for "image histogram" and "image quantization", because it seams like these are the most common terms. No luck yet.


I am surprised, image histograms are very common. However, if you are looking for tri-color histograms as apposed to single channel (red only, blue only, etc.), that is why. You will find that in most natural images (not created artificially on a computer, or touched up), that most true color (RGB) references will have a very low count. Why? Well, to be frank, it is because in 24bit color (RGB, 8 bits each), any given single color reference is 1:16,777,216 and a given image such as 1024x768 is only 786,432 pixels. Even going up to a relatively large image size, 2921 x 2184 which is a 6megapixel image, the odds of having any given color combination more than once is very low. So doing a color histogram on the complete 24bit color value will generally produce a histogram count of 1 or 0 for all colors with the occasional exception.

If you have seen the posters that use images as tiles to reconstruct another much larger image, these are done by classifying the over-all hue of the image. A histogram and color analysis is easy on a single channel, since it is just a series of 256 values. Over a six megapixel image or even something as small as a 1024x768 image, the number of counts of any single value are easily histogrammed and classified.

Plus as mentioned above by others, you can change color-space to get other channel references. Common channel references are RGB CMYK and YUV. You simply convert color space to the appropriate system, then examine your histogram on any given channel. You can even do all three color spaces and histogram each channel to see which classifies your image best.



_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

AnswerRe: Most common used color in an image? Pin
Chris Losinger26-Sep-07 5:19
professionalChris Losinger26-Sep-07 5:19 
Questionold unix gl mook mosies over to VS 8 beta 2 Pin
dr d b karron6-Sep-07 11:32
dr d b karron6-Sep-07 11:32 
AnswerRe: old unix gl mook mosies over to VS 8 beta 2 Pin
El Corazon8-Sep-07 5:19
El Corazon8-Sep-07 5:19 
QuestionImange Manipluation with Asp.Net Pin
Mustakim Mansuri5-Sep-07 19:43
Mustakim Mansuri5-Sep-07 19:43 
QuestionTextureLoader - InvalidOperationException Pin
Katerinochka4-Sep-07 5:52
Katerinochka4-Sep-07 5:52 
Questiondisplay driver Pin
amit.code3-Sep-07 22:46
amit.code3-Sep-07 22:46 
AnswerRe: display driver Pin
Christian Graus4-Sep-07 4:23
protectorChristian Graus4-Sep-07 4:23 
QuestionGraphics for Unix in C++ Pin
MartyExodus3-Sep-07 11:54
MartyExodus3-Sep-07 11:54 
AnswerRe: Graphics for Unix in C++ Pin
El Corazon4-Sep-07 4:02
El Corazon4-Sep-07 4:02 
QuestionCatching and Processing GDI+ Exception Pin
ss42a3-Sep-07 5:34
ss42a3-Sep-07 5:34 
AnswerRe: Catching and Processing GDI+ Exception Pin
Luc Pattyn3-Sep-07 6:00
sitebuilderLuc Pattyn3-Sep-07 6:00 
GeneralRe: Catching and Processing GDI+ Exception Pin
ss42a3-Sep-07 6:11
ss42a3-Sep-07 6:11 
GeneralRe: Catching and Processing GDI+ Exception Pin
Luc Pattyn3-Sep-07 6:23
sitebuilderLuc Pattyn3-Sep-07 6:23 
GeneralRe: Catching and Processing GDI+ Exception Pin
Luc Pattyn3-Sep-07 7:18
sitebuilderLuc Pattyn3-Sep-07 7:18 
GeneralRe: Catching and Processing GDI+ Exception [modified] Pin
ss42a3-Sep-07 7:53
ss42a3-Sep-07 7:53 
QuestionDetermine the video size Pin
Andrewfx20061-Sep-07 23:21
Andrewfx20061-Sep-07 23:21 
GeneralRe: Determine the video size Pin
tanvon malik2-Jan-08 4:18
tanvon malik2-Jan-08 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.