I know that a 24 bit image dedicates 8 bit each for R, G and B. Is it just for RGB color space. In YCbCr color space for a 24 bit JPEG image, how are the bits distributed?
|
There are a few formats for YCbCr. generally speaking the eye is more sensitive to changes in luminance (Y, brightness) than to changes in chroma (Cb, Cr, color). Thus, it is possible to erase some chroma information while retaining image quality. Thus, the most "expensive" format is 4:4:4, where for each luma (Y) component there are 1 Red difference (Cr) and one Blue difference (Cb) components. Then, applying the principle I mentioned, there is 4:2:2 where for each 2 Y components there are 1 Cb and 1 Cr. And it goes even further to 4:1:1 and 4:2:0, etc. More info here. |
|||||||||||||
|
|
A JPEG may start out with 8 bits per R, G and B channel, but when stored in the JPEG it is stored very differently, where there is no real "bit depth" but instead values are stored as frequency coefficients of a given precision. In JPEG what's more relevant is the quantization rate, which affects how much information is thrown away during the quantization stage of compression and thus how precise each coefficient is. This quantization rate is set by the "quality" setting when you save a JPEG in photoshop. It is not related to the bit depth as in a raster image though, and you could even say that a JPEG image doesn't have a bit depth while in JPEG format, although JPEG encoders/decoders start with/end with a 24-bit raster image. The other major factor relevant in saving a JPEG is the chroma sub-sampling type. In a JPEG, you have the option of halving the horizontal, or both the horizontal and vertical, resolution of the color (Pr and Pb) channels relative to the luminance (lightness) channel. When decompressing, the color channels are interpolated and in most photographic subject matter it doesn't make a huge amount of difference. Here's a rough summary of how an image gets turned into a JPEG.
It's impossible to say that a certain quantization factor is equivalent to a certain bit depth since quantization does not give banding like when you reduce the bit depth, but instead gives an overall perceptual loss in detail, starting in the parts where you'd notice it less because it's of such low amplitude for its frequency. |
|||||||||||||||
|
|
Representing the chroma (Cb Cr) in separate channels from the luma (Y) has another positive effect on compression. Most of the visible information is in the luma channel. Human eyes tolerate both lower spatial resolution and more aggressive quantization in the chroma channels. So an aggressively compressed image can end up consuming about 10% of the file space for chroma, and the rest for luma, and still look decent. At the end of the day it's still lossy compression. |
|||
|
|
|
Approximately 8 bits for each channel, but there are several slightly different ways to do it. The details are given in the Wikipedia article on YCbCr. |
|||||||
|