Before the rush

Before the rush
by evan-pak

Submit your Photo
Hall of Fame

Please participate in Meta
and help us grow.

Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bespoke Image Capture & processing flow, wherein I do the following operations:-

Capture Raw data-->De-Bayer(Get RGB)-->Color Balance-->RGB-to-YCbCr-->Image sharpening-->Denoise filtering-->YCbCr-to-RGB-->Gamma correction(Gamma encoding)-->Store the file as BMP.

But now as some new requirement, I need to store the final output file in YUV/YCbCr format. So the new flow would be:

Capture Raw data-->De-Bayer(Get RGB)-->Color processing-->RGB-to-YCbCr-->Image sharpening-->Denoise filtering

My questions is now where should I apply the Gamma correction, since there is no conversion back to RGB space after the image sharpening and denoise filtering in YCbCr space?

Will it yield same/similar image quality when viewed, if I apply gamma correction in RGB space after Color balance, before it is converted to YCbCr space and thus before Image sharpening and denoising?

Any pointers appreciated.

thank you.


share|improve this question

Gamma should be applied on luminance (Y in your case) as it pertains to contrast.

There should be no reason to do it in RGB. I suspect many programs do it independently on each channel rather than on luminance to avoid converting back and forth. Results should actually be at least a little better doing it on luminance.

share|improve this answer
But then Gamma also means how colors look on the screen. So why not apply on chrominance channels(Cb,Cr)? – goldenmean Feb 18 '11 at 14:42
@goldenman - Not really. Think about the standard gamma test where you have a solid block of color near alternating stripes of color and black. The relation between the solid color and the way our eye sees the average of the stripes is about the luminance curve of the display (or medium in case of prints). – Itai Feb 18 '11 at 15:57
And I guess Gamma should be related to brightness (perceived intensity), rather than contrast.Correct me if wrong. But got your point about Gamma related more to Luminance component than chrominance component. – goldenmean Feb 18 '11 at 16:12
@goldenmean - Yes! Note that brightness and contrast are correlated on most displays. It is hard to change contrast or brightness without affecting the other. That is why the contrast ratio of a display is computed at a specific brightness. – Itai Feb 18 '11 at 16:23

The BT.709 standard as does the sRGB standard define that gamma correction should be applied to each RGB channel independently, not only on the Luma channel as the first answer implies.

share|improve this answer

Brightening gamma in Luminance channel tend to change the perception of colour. Satuaration seems to increase, particularly yellow, since yellow maxes out luminance next to white.

Left column: RGB

Right column: Y in YUV

Top: brightening gamma

Bottom: darkening gamma.

gamma in rgb vs y in yuv

I think RGB gamma is more pleasing/intuitive when brightening and Y gamma when darkening.



Other notes: WB and noise reduction is normally done on the raw before demosaicing when that data is available.

share|improve this answer

Consider Capture Raw data--> white balance --> gamma --> De-Bayer(Get RGB)

share|improve this answer
Why that order? And what about the YCbCr conversion? Not really a helpful answer without at least some explanation. – MikeW Sep 1 '14 at 21:46
The order allows to handle white balance while still in linear space, and not be concerned with gamma at later stages. YCbCr conversion goes the standard way, as YCbCr conversion starts with gamma-encoded RGB. In case you want to go with linear encoding, it is YcCbcCrc. – Iliah Borg Sep 1 '14 at 22:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.