Each RGB value is represented as an 8-bit integer (0-255). Why not store it as a decimal number to increase the color space? It should give more realistic looking picture.
Colours are sometimes represented by three floats instead of as 24 bits.
The 8 bit standard is historical: It goes back to the days of 8 bit architectures. 3 bytes can give the colour of a pixel without wasting any memory and having the same number of bits for each colour component.
This has some advantages: you can write the colour as a 6 digit hexadecimal number and have some idea of what the colour will be:
0xff0000 : Red
0x00ff00 : Green
0x0000ff : Blue
And so on. This is quite compact and efficient and has stuck around, as a colour can be held in a single integer value instead of three floats.
I want a software to be able to convert a given "pipetted" input color from a photography with a HSV-representation into a human-readable descriptor of a base color. So no matter which combination of HSV-values I pick from a color wheel, it would be converted to the closest "neighbor" of a given, limited number of base colors.
Maybe this is a similar question, because it also ennumerated base colors?
I don't seem to find how I can normalize YCbCr color format. For example, it is common to divide by 255 every number of an RGB image. So, what's is that for YCbCr? Or, it doesn't make any sense?
It is your assumption that values of RGB are between 0 to 255 (per channel). HTML standardized it, but there are many other possibility. 0 to 1 (and I think this will be the future) or 0 to 100 are standard choices. Video format have often a range or R, G, B from 16 to 235 (but allowing some extra values for super white or blacker black, just 0 and 255 are reserved), and just for 8 bits per channel. If you have 10 or 12 bits per channel, you have other maximum values (video format defines such limits). My screen is 10bit per channel, so my RGB is not 0 to 255.
Cb and Cr have usually values between 16 and 240. Y from 16 to 235, if 8 bit per channel. For more bits per channel, there are other limits.
Note: some video format allow also full range, so Y, Cb and Cr from 0 to 255.
You should keep in mind that RGB, YcbCr, etc. are just color models. The implementation defines exactly the range, the chromaticies, the gamma, and other details. Picture and video formats usually allow many kind of colour space (usually defined in the headers), so you should check which kind of RGB or YCbCr you are encoding/decoding.
ADDENDUM (from comments).
Just a division is not good, because some values are reserved (0 and 255 for 8 bits; a larger range for encoding with more bits per channel), and as I wrote above, other values should be displayed in an equivalent manner (as pure white or as pure black).
So you for X you should do (Y-16)/(235-16) and clip values to that result will be in the range 0 to (235-16). In an analog manner for C channel (but using maximum value of 240 (instead of 235).
i assume it depends on computer display...
but does it depend on Operating System??
for example, color codes: #ff0000, #2e2e2e - three bytes used, obviously..
but how are these data (color codes) interpreted on the lowest level??
How does application renders color on the lowest level??
Thanks in advance!!
These codes are a compact representation of three integers between 0 and 255: Red, Blue, and Green.
They are rendered by the video card using the RGB color model.
RGB is treated as red, green, blue, with each value being an integer from 0 to 255 inclusive. You could represent red for example as (255,0,0) or #FF0000, or many other different ways.
Whatever software is using the color tells your operating system's graphics drivers to output to your monitor. They vary from OS to OS, but the output that comes out of the port has to be standardized to the hardware.
http://en.wikipedia.org/wiki/RGB_color_model#RGB_devices
Sometimes it can depend on the operating system. Older versions of Mac OS and Next used RGB values with a different gamma coefficient from that produced naturally by a monitor. Their video systems would convert these values before displaying them. Today you will mostly encounter sRGB, which was an attempt by Microsoft and HP to specify the average display system at the time it was created. Sometimes you'll run into other systems such as Adobe RGB, which has the ability to display slightly more colors than sRGB.
Computers use the RGB color model. In RGB, everything starts off as black and then you add some red/green/blue on top of that. The more of each color you add, the brighter it gets. Adding an equal amount of red/green/blue will create shades of grey (white if the max possible of all three colors are added).
This closely matches how the human eye picks up colors, so it works well (no light is black, max light we can see is blinding white, and light can be in different wavelengths to specify it's colour. If we see a red green and blue light right next to each other, it appears white to our eye. Look at your computer screen under a magnifying glass and you will be able to see it has red green and blue dots which all turn on when it's white).
The color codes you mentioned are "hex" color codes. It is three hex numbers joined together. #ff0000 is "ff red", "00 green", "00 blue". ff is the highest possible two digit number in hex (it works out to 255 in standard decimal format), while 00 is the lowest possible two digit number (0 as a decimal number).
#2e2e2e is 2e of each red/green/blue, so creates a shade of grey. 2e is hex for the 47, which is much closer to 0 than to 255, so it creates a dark grey.
Hex is a "16 bit" number format, compared to the decimal format we are used which is 10 bit. This means you can have larger numbers with less digits, and 16 bit happens to be easier to work with for hardware video cards. The possible digits for the hex system are:
f, which is 15 in decimal
e, which is 14
d, which is 13
c, 12
b, 11
a, 10
9, which is 9 in decimal
8, which is 8
7, 7
6, 6
5, 5
4, 4
3, 3
2, 2
1, 1
0, 0
More info about hex: http://en.wikipedia.org/wiki/Hexadecimal
More info about RGB: http://en.wikipedia.org/wiki/RGB_color_model
And more info about "web colors", which is what you're using: http://en.wikipedia.org/wiki/Web_colors
how to get RGB values in percentage in photoshop.
and is cmyk percentage values are similar to RGB?
RGB and CMYK are different color modes.
RGB colors are screen colors. It is expressed in absolute values, usually in integer values from 0 to 255, representing the brightness on the screen. The exact range of values depends on the color depth of the image. The higher the value, the more light of that color is added, so the highest color is white.
CMYK colors are printing colors. They are used to represent the amount of ink used for a pixel. This is no absolute value, because it is merely a ratio between the color components. The higher the value, the darker it gets. 100% of each is (near) black, although real black is usually constructed by using 100% of K (key) and about 30% of each of the other components.
integer values from 0 to 255 are for 8 bit color, in the day of 16 or 32 bit color it would make sense to be able to view rgb as percentage values.
this is being added to Adobe lightroom currently does percentaes unless you're in the develop module, in soft proof mode