# global color histogram

• February 28th, 2013, 12:19 PM
larbie
global color histogram
hey
i can't understand this line,plz tell me what is the meaning of 64 color value and on which base it classify/covert RGB in 0 t0 63 integer??
"the global color histogram, method returns 64 color values represent the probability of pixels in the sample image of a particular color."

below the line code return integer values from 0 to 63 for any RGB value . image.getRGB(x,y) return RGB value of pixel at x,y position.
(image.getRGB(x,y)>>18 & 0x30) | (image.getRGB(x,y)>>12 & 0xc) | (image.getRGB(x,y)>>6 & 0x3)
• February 28th, 2013, 12:28 PM
Norm
Re: global color histogram
The formula at the bottom of your post builds a 6 bit number from the value returned by getRGB() method.
2^6 is 64
If you OR together the & bit values you should get: 0b111111 from: 0x30 | 0x0c | 0x03
• February 28th, 2013, 12:42 PM
larbie
Re: global color histogram
but on which base ,for different RGB value it return same integer y??
• February 28th, 2013, 01:10 PM
Norm
Re: global color histogram
Quote:

but on which base ,for different RGB value it return same integer y?
Yes it will return the same value for many colors. That is what the histogram is for. To display the number of different colors that had the same value in the 0-63 range produced by the formula.
• February 28th, 2013, 01:50 PM
larbie
Re: global color histogram
okk i got it.will it reduce the quality of image color or the accuracy of histogram??
if i use this same technique for 8 bit 0-255,because java use 8 bit to represent color code like
(image.getRGB(x,y)>> 16 & 0xff) | (image.getRGB(x,y) >> 8 & 0xff) | (image.getRGB(x,y)& 0xff)
which is better ,6 bit or 8 bit ??
• February 28th, 2013, 01:55 PM
Norm
Re: global color histogram
Quote:

will it reduce the quality of image color or the accuracy of histogram??
I don't know how it effects the colors. The histogram counts what it is supposed to count. Whoever devised the bit sampling technique should be asked what the histogram is suppose to be counting.
• February 28th, 2013, 02:13 PM
larbie
Re: global color histogram