IP 06 · Why does brightening turn reds and oranges yellow, then white?
IntermediateIP 06 · Color Image ProcessingImage lab
Description
Multiply a real color photo by a gain and compare three ways of handling the channels that overflow: clip each one, rescale the pixel, or tone-map it.
Try this: Set the gain to 2 with per-channel clipping and look at the hue map: the wooden table and the coffee are red (hue moved) and the bright cup walls are blue (colour lost). Raise the gain to 4: why do the orange bars of the hue histogram pile up in one bin at 60° (yellow), and where do the other pixels go? Now switch to rescaling: what does not change, and what does the picture lose instead?
Explanation
Answer the prediction first, or open the explanation when you are ready.
Show the explanation
Doubling gives (400, 200, 80), but a byte stops at 255, so R is cut and the pixel becomes (255, 200, 80). The ratio R : G was 2 : 1 and is now about 1.3 : 1, so the red part shrank relative to the green part and the hue angle grows from 22.5° to 41.1°, toward yellow at 60°. Saturation falls from 0.80 to 0.69. Brightening more cuts G as well and the pixel approaches (255, 255, 255), yellow first and then white. Rescaling the pixel by its largest channel instead gives (255, 127.5, 51), which keeps the 22.5° hue.
Lab · IP 06 · Why does brightening turn reds and oranges yellow, then white?
Loading image…
Try this: Set the gain to 2 with per-channel clipping and look at the hue map: the wooden table and the coffee are red (hue moved) and the bright cup walls are blue (colour lost). Raise the gain to 4: why do the orange bars of the hue histogram pile up in one bin at 60° (yellow), and where do the other pixels go? Now switch to rescaling: what does not change, and what does the picture lose instead?
Photo: the coffee test image reduced to 256 × 171 (CC0, Rachel Michetti). The gain multiplies the stored 8-bit sRGB values directly, like np.clip(g * x, 0, 1) in the Images as Arrays chapter; a real exposure change acts on linear light, so the numbers would differ but the story would not. Overflow means some gained channel exceeds 255. Clip: each channel is cut at 255. Rescale: an overflowing pixel is divided by its largest channel, so the channel ratios, hence the hue, survive, but its largest channel always ends at 255. Tone map: a Reinhard-style operator L(1 + L/g²)/(1 + L) on the luma L of the gained pixel (white point g, the gain), applied as one common factor to R, G and B, followed by clipping of any channel still above 255. Hue is the HSV hue angle in degrees (red 0°, green 120°, blue 240°), close to but not identical with the chapter’s HSI hue. Pixels with HSV saturation or value below 0.1 have no usable hue and are left out of the hue statistics; a pixel that was coloured but ends below 0.1 saturation counts as colour lost. Saturation is HSV saturation, averaged over coloured pixels that overflow.
Method and image sources
- Rafael C. Gonzalez & Richard E. Woods, Digital Image Processing, 4th ed., Pearson, 2018, Chapter 6
- Erik Reinhard, Michael Stark, Peter Shirley & James Ferwerda, Photographic Tone Reproduction for Digital Images, ACM Transactions on Graphics (SIGGRAPH), 2002
- Alvy Ray Smith, Color Gamut Transform Pairs, ACM SIGGRAPH Computer Graphics, 1978 (the HSV model)
- scikit-image test image coffee: CC0 by the photographer, Rachel Michetti (courtesy of Pikolo Espresso Bar)
- scikit-image test images (skimage.data): camera is CC0 by Lav Varshney; coins is from the Brooklyn Museum collection, no known copyright restrictions; astronaut is a NASA photograph in the public domain