I'm taking pictures of little surfaces (5 x 5 Millimeters) in an experimental setup with an ids camera that contains a cmos sensor. Afterwards the pictures are split into the 3 color channels (red, green, blue) for further processing.

Before we started evaluating the pictures, my boss asked me to find out how different settings of the camera affect the pictures that are taken. The camera parameters allow for individually setting the gains for the overall brightness, as well as for every individual color (red, green blue). Any of these gains is said to take place inside the camera (analog gain, according to the manual), not in the software.

We then observed something we don't understand, maybe somebody around here can help: Whenever we changed the settings of an individual color channel (for example, the gain for the green signal), the value of this signal changed in a proportional way. So far soo good. Bad thing is: The other 2 channels (which we expected to not be affected at all) reduced their values significantly throughout enlarging the gain for the green channel.

Can somebody tell us, why that is the case, wether it is a usual behaviour, or how we could stop the signals for red and blue being affected by the gain for the color green?

Additional information: White-balance is turned off (this setting enables me to adjust the individual color gains in the first place). The camera Model is "UI-3280CP", Version "C-HQ" (Color - High Quality) by "IDS", the sensor is a global-shutter cmos sensor called "IMX264".

Additional Information: The decrease in the colors "blue" and "red" stopped as soon as the color green got into saturation (reached the value 255):

  • 3
    I'm voting to close this question as off-topic because its about using a camera as a measurement device and not about photography. See engineering.stackexchange.com. Specifying the camera/sensor make/model could also help get an informed answer.
    – xenoid
    Jul 29, 2019 at 11:43
  • 1
    I added Information about the camera model. I think this question is as useful/interesting to users of this site as comparable questions about the Details of "iso"-sensitivity, or different color channels. We take pictures and want to know how different settings affect the colors of the final result. Wether the result will end up in a database or in a photo album, should not matter in deciding wether the question is useful to the community. Jul 29, 2019 at 12:00
  • 3
    Still it's a laboratory camera, very different from a photographer's camera (where for instance you cannot directly adjust the gains for each color channel).
    – xenoid
    Jul 29, 2019 at 13:14
  • You may find answers also in the forum of DPreview, which has a section for this kind of technical discussions.
    – FarO
    Jul 29, 2019 at 15:32
  • if you care about individual channels, simply use RAW data. adjusting invididual RGB gains is then on your side and you can process everything in a predictable way, instead of relying on undisclosed algorithms hidden in the camera software.
    – szulat
    Jul 23, 2020 at 7:14

5 Answers 5


There are both color and monochrome versions of this camera according to the manufacturer webpages. They have similar sensor numbers and identical resolution, but different sensitivity curves. That makes it more than likely that the color version works with a filter array, a Bayer color filter. RGB information will only be available after "demosaicing" which means that the processed RGB information does not just come from unprocessed GRBG pixels. Even if those pixels were to feature independent analog gains (which I'd consider somewhat dubious without further information), the resulting demosaiced RGB information would not be independent from results of the individual channels. This would be particularly noticeable when some of the pixels/channels got into saturation.

  • With demosaicing algorithms that use information from surrounding sensels to guide interpolation, I'd expect values in the RB channels to move in the same direction as values in the green channel. The question is about why values in the RB channels decreased while values in the green channel increased.
    – xiota
    Jul 30, 2019 at 11:21

Due to the sensitivity of the filter arrays on the different sensors, a purely green color would be expected to also cause some increase in the raw red and blue channel data.

So if the raw green data increases in intensity, the raw red and blue data should also rise somewhat even given pure green colors, and the RGB color deduction/demosaicing algorithm apparently compensates for that expectation even when the camera should know that additional gain has been applied to the raw green channel. The theory that it is the conversion from raw sensor channels to a more computationally useful RGB model that is responsible is also given weight by saturation in the values of the green channel stopping further changes to the R and B channels. That makes it very likely that the negative correlation is established in the digital domain since it stops when the digitisation threshold is reached.


An RGB sensor does not have pixels that sense only R/G/B. The green filter typically allows some blue and red to pass, and the blue and red filters typically extend into/towards the green spectrum.

These spectral response curves function much like the human eye where the retinal cones are identified as being short/medium/long wavelength sensitive (rather than RGB). And for both the camera and human vision the green-yellow (medium) wavelengths are primary in providing luminance values for the scene/image overall. That's why the typical color filter array has 2x as many green-centric filtered pixels than it has either blue or red.

I would expect adjustments to the green channel to also have significant impact on both the blue and red channels, due to the overlap in response curve, and it's importance as overall luminance. And I would expect adjustments to either blue or red to have a lesser impact on the green channel (which might then have a follow-on effect on the opposite channel).

See here for sample response curves: https://www.maxmax.com/faq/camera-tech/spectral-response

  • Even though the green sensels respond somewhat to red and blue wavelengths, the red and blue wavelengths are not separable from the signal from the green sensels. So if the gain on the green sensels could be controlled independently, regardless of spectral response, it wouldn't affect the signal from the other sensels.
    – xiota
    Jul 29, 2019 at 14:26
  • @xiota It would not affect the raw numbers from the R and B senbsels, but it would affect the interpolated R and B values for every pixel. The CFAs on Bayer masks are not centered on the wavelengths of our RGB color reproduction systems. :"Red", particularly, is quite different on a typical bayer mask centered at about 590-600nm (more yellow or yellow/orange than red at about 640nm) than on an RGB output device.
    – Michael C
    Jul 30, 2019 at 0:58
  • @xiota You fail to recognize that some "red" light and some "blue" light pass through the "green" filters and are recorded by the green pixels. Thus, the light recorded by the "green" sensels ultimately affects the demosaiced values of red and blue pixels, which is what the OP is seeing when they look at their screen and see the result of changing the gain on the green-filtered sensels. Since the OP states that the gain controls an analog green signal, it must necessarily be done before demosaicing which happens post analog-to-digital conversion.
    – Michael C
    Jul 30, 2019 at 7:53
  • No, but it can be interpolated by comparing the relative brightness of adjacent photosites filtered for different colors. That is exactly what demosaicing does!
    – Michael C
    Jul 30, 2019 at 8:05
  • 1
    It's both, I thought that was apparent by the inclusion of the importance of the green channel for overall luminance of the output image. In order to demosaic the raw data appropriately the response curves must be known and applied in the algorithm. And I don't believe you can have RGB output data w/o the raw data being demosaiced (i.e. green saturated at 255). Aug 1, 2019 at 17:06

The other 2 channels (which we expected to not be affected at all) reduced their values significantly throughout enlarging the gain for the green channel.

The problem may be related to color-space conversions when the raw data is processed. This is independent of when gain is applied (analog or digital).

Increasing the gain of a channel is equivalent to shifting it to the right on a histogram. Here are histograms from a raw file to illustrate what happens when each channel is shifted to the right when the working and output color spaces do not match.

histogram 1

Here is what happens when the working and output color spaces do match.

histogram 2

Other possible causes, such as demosaicing guided by neighboring sensels, would be expected to increase the values in the blue and red channels along with the values in the green channel.

Naive/simple demosaicing methods and pixel binning, which treat each channel independently of the others, would behave as you expect, the RB channels would be unaffected by changes in the green channel.


The first thing one must realize to understand what is going on here is that the colors of a Bayer filter array do not correspond to the colors of an RGB color system.

It's covered in much more detail in this answer to Why are Red, Green, and Blue the primary colors of light?

The short answer is that each of the filters in a Bayer mask allow a wide range of wavelengths through. They are attenuated for a peak transmission at about 455nm ("Blue"), 540nm (Green), and 590-600nm ("Red"). There is also a lot of overlap between what gets through each filter compared to the others.

The three color filters for most Bayer masked "RGB" cameras are really 'blue-with a touch of violet', 'Green with a touch of yellow', and somewhere between 'Yellow with a touch of green' (which mimics the human eye the most) and 'Yellow with a lot of orange' (which seems to be easier to implement for a CMOS sensor).

enter image description here

This mimics the three types of cones in the human retina:

enter image description here

But our RGB color reproduction systems use values of around 480nm (Blue), 525nm (Green), and 640nm (Red) for the three primary colors. Some screens also include Yellow subpixels emitting at about 580nm.

enter image description here

As you can see, the peaks of the detectors used in our cameras do not match the colors used in our output devices. The R, G, and B values for each pixel must all be interpolated from the raw values of the sensels covered with "R", "G", and "B" filters because "R" ≠ R, "G" ≠ G, and "B" ≠ B.

This means that when you attenuate the "Green" channel, even if the "Red" and "Blue" channels are not affected, when the information from all three channels are demosaiced to provide color information, the differing "Green" value will affect the calculation of all three Red, Green, and Blue values.

For further reading:
Why are Red, Green, and Blue the primary colors of light?
Why don't mainstream sensors use CYM filters instead of RGB?
RAW files store 3 colors per pixel, or only one?
What does an unprocessed RAW file look like?
Why do we use RGB instead of wavelengths to represent colours?
Why don't cameras offer more than 3 colour channels? (Or do they?)
What are the pros and cons of different Bayer demosaicing algorithms?

  • Can you "Kind of" scheme the attenuating process in this? Jul 30, 2019 at 6:59
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – AJ Henderson
    Jul 30, 2019 at 11:57
  • This answer does not explain why the values in the RB channels would be reduced when values in the G channel are increased. This answer appears to assume that the green channel is "attenuated" (reduced), but the question specifically mentions "enlarging the gain for the green channel".
    – xiota
    Jul 30, 2019 at 13:55
  • "when the information from all three channels are demosaiced to provide color information, the differing "Green" value will affect the calculation of all three Red, Green, and Blue values." - This statement is not true of all demosaicing algorithms. For those that it does apply to, the RB values are unlikely to be decreased as a result of the G values being increased.
    – xiota
    Jul 30, 2019 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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