1 / 43

Understanding Color: Light, Perception, and Gamma Correction

This chapter explores the basics of color, including the nature of light, the human perception of color, and the importance of gamma correction. It covers topics such as color spectra, RGB values, gamma correction in cameras and CRT displays, and the non-linear nature of human vision.

jameswhite
Download Presentation

Understanding Color: Light, Perception, and Gamma Correction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2: Color Basics

  2. What is light? • EM wave, radiation • Visible light has a spectrum wavelength from 400 – 780 nm. • Light can be composed of radiation of various wavelengths. • Light can be described by a spectral power distribution (SPD). wavelength B G R

  3. What is color? • Human retina has • 3 types of color photoreceptor cone cells • rod cells (only effective at extremely low light levels, or night-vision). • When light falls on the retina, the 3 types of cone cells response (at different levels) to create the sensation of color. • CIE (Commission Internationale de L’Eclairage) specifies how an SPD can be transformed into tri-stimulus values that specify a color.

  4. What is color? • Given 3 primary lights: red, green, and blue, most colors can be described by a triplet RGB. Each value is (linearly) proportional to the physical power (radiance) of a component light. • We call these linear RGB values. R=0.81 G=0.52 B=0.56 R=0.36 G=0.69 B=0.74 R=0.0 G=0.0 B=0.69 R=0.0 G=0.0 B=0.91 R=0.69 G=0.69 B=0.69 R=0.91 G=0.91 B=0.91

  5. Gamma • A color CRT has 3 types of phosphors that emit different-colored (RGB) light. • A typical CRT has a non-linear transfer function. That is, the amount of power (luminance) emitted is approximately proportional to the applied voltage (scaled to the range [0,1]) raised to a constant power, commonly called gamma, . • Luminance  Voltage • Typical CRTs have gamma values close to 2.5.

  6. Gamma luminance 1 gamma < 1 gamma = 1 gamma > 1 voltage 0 1

  7. Gamma luminance 1 gamma < 1 gamma = 1 0.176 gamma > 1 voltage 0 0.5 1

  8. Gamma luminance 1 gamma < 1 gamma = 1 gamma > 1 0.031 voltage 0 0.25 1

  9. Gamma correction • A camera records the luminance (i.e., radiance) of an object. If the recorded values are translated into a voltage signal, and applied directly to a CRT, the reproduced image will have a distorted luminance. • A typical camera, therefore, applies a gamma correction transfer function. That is, it applies a 1/gamma power function to the recorded RGB values: • R’ = R1/gamma (likewise for G and B) • Note: the RGB values used in the formula are all normalized to the [0,1] range.

  10. Gamma (example) as displayed on a CRT without gamma correction original

  11. Gamma correction • The gamma corrected values R’G’B’ are distinguished from the original RGB values by the prime notation. They are called non-linear (or gamma corrected) RGB. • When we are processing digital images, the pixel values we are dealing with are usually the non-linear (R’G’B’) values.

  12. Gamma correction eye RGB RGB camera gamma correction R’G’B’ computer R’G’B’ CRT x x1/ (x1/) 

  13. Lightness • Human vision has a non-linear perceptual response to luminance • e.g., a source having a luminance (power) of 18% of another source appears about half as bright. • The perceptual response to luminance is called lightness. • The transfer function of human perceptual response to luminance resembles (very roughly) a 0.4 power curve, i.e., • Lightness  Luminance0.4

  14. Lightness RGB computer R’G’B’ CRT y y (y)0.4 lightness pixel value intensity

  15. Lightness • 0.4 * 2.5 = 1.0. Hence, amazingly, the human transfer function is roughly the inverse of that of a CRT. • Recall that the nonlinear R’G’B’ values are (usually) used in a computer as pixel values. • The nonlinear values are used to drive a CRT’s voltage for controlling the brightness of phosphors. • The luminance emitted by a CRT is a 2.5 power curve. • The human vision system has a transfer function of a 0.4 power curve. • Hence, the nonlinear R’G’B’ values are approximately proportional to lightness (a perceptual value).

  16. Luminance efficiency • If one looks at 3 light sources: red, green, and blue, each at the same power, then the green source appears the brightest, followed by the red source and then by the blue source. • Human vision system is more sensitive to luminance than to color. A video system usually encodes RGB as 1 luminance component Y’ (or luma) and 2 chrominance components. • The chrominance components are usually given lower bandwidth (or data capacity) than the luminance component.

  17. Color differences • Luma (Y’) can be computed as a weighted sum of non-linear R’G’B’ components: (ITU-R Recommendation BT. 601, formerly known as CCIR 601) • Y’ = 0.299R’ + 0.587G’ + 0.114B’ • Color differences refer to color components where (informally) “brightness” is “removed”. • The standard is to subtract luma from non-linear blue, and from non-linear red: • B’-Y’ and R’-Y’ (these are called chroma).

  18. Scaling chroma • Various scaling factors are applied to the chroma (B’-Y’, R’-Y’) for different applications: • Y’PBPR – for component analog video • Y’UV – for composite analog video (PAL) • Y’IQ – ditto (NTSC) • Y’CBCR – for digital images and video

  19. Y’CBCR • Rec. 601 specifies a range of [16, 235] for Y’ and [16, 240] for CB and CR. • To obtain Y’CBCR from 8-bit R’G’B’ values (i.e., in the range [0, 255]), use the transformation:

  20. Chromatic sub-sampling • The CB, CR chroma components are usually sub-sampled to reduce the data requirement in digital images and video. • 4:2:2 sub-sample chroma horizontally by a factor of 2 (Rec. 601). a row of pixels take these chroma values

  21. Perceptual uniformity • Human vision responds to about a hundred-to-one contrast ratio. That is, if the difference in brightness of two dots is less than 1%, our eyes won’t detect the difference. Can you see the circle? decreasing I I+I I

  22. Contrast ratio • Contrast ratio refers to the ratio of luminance between the brightest spot and that of the darkest spot of a particular device and environment. • Example: 30:1 (TV, home with mild lighting)

  23. Why 8 bits per sample • Let L be the intensity level of the darkest spot. With a contrast ratio of 20, the brightest spot has an intensity of 20L. • We need: • 1 code to represent dark (i.e., L) • 1 code to represent 1.01 dark (i.e., 1.01L) • 1 code to represent (1.01)2 L • … • 1 code to represent 20L • Hence, we need about 300 codes (or quantization levels) • 8 bits are used because they can be conveniently packed into a byte.

  24. Perceptual uniformity • If we use an 8-bit linear coding system to represent luminance (i.e., intensity), we may not be making good use of the 256 codes. 25 100 200 Y 0 255 26 101 201

  25. Perceptual uniformity • If we use an 8-bit linear coding system to represent luminance (i.e., intensity), we may not be making good use of the 256 codes. 25 100 200 Y 0 255 26 101 201 ? ?

  26. Contouring • Luminance codes above 100 suffer no artifacts due to visibility of the jumps between codes. Some codes are not useful. • Also, successive codes that are near black has poor luminance resolution. This leads to contouring. 25 26 27

  27. 5 bits 32 gray levels Contouring 8 bits 256 gray levels

  28. Perceptual uniformity • If we code the non-linear gamma corrected value (i.e., luma) instead, contouring is ameliorated. 25 100 200 0 255 26 101 201 0.098 0.391 0.781 Y 0 1 0.102 0.395 0.785 0.539 0.394 0.687 0.906 0 1 Y’ 0.401 0.689 0.908 101 232 175 0 255 103 176

  29. Gamma Correction • Gamma correction thus helps: • to compensate the non-linearity of a typical CRT; • to allow perceptually uniform coding.

  30. True color • A true color system (or a 24-bit system) represents a pixel by its RGB (or R’G’B’) values with 8 bits for each component. • A 24-bit system allows us to describe 224 = 16,777,216 different colors. In many cases, such a high color resolution is not needed. • Example: • How many different colors can you see in • a 640  480 image? • your window desktop?

  31. Pseudocolor/indexed color/ colormapped system • To save storage space, we can analyze an image to find out all the distinct colors that are present in the image. • Let n be the number of distinct colors found (usually n << 16.7M). We assign a code to each distinct color. • We keep a Color Lookup Table (CLUT, or colormap, or palette) that translates a code to its corresponding RGB values. • Each color is thus represented by log2n bits.

  32. CLUT • Using the CLUT approach, • we waste space for storing the CLUT. • we save space by using fewer bits for each pixel. • Usually the latter factor outweighs the first.

  33. 248 distinct colors CLUT

More Related