LECTURE 8 Colors in Images & Video CS 5513 Multimedia Systems Spring 2009 Imran Ihsan Principal Design Consultant OPUSVII www.opuseven.com Faculty of Engineering & Applied Sciences
1. Light and Spectra Visible light is an electromagnetic wave in the 400nm 700 nm range. Imran Ihsan Faculty of Engineering & Applied Sciences CS5513 - Multimedia Systems Slide: 2
2. The Human Retina The eye is basically similar to a camera Humaneyeshavetwotypesofsensorcells: Rods Sensitive to intensity Insensitive to colour Cones Respond to colours Three types (red, green and blue) respond to different wavelengths of light. Slide: 3
3. Cones and Perception Cones come in 3 types: red, green and blue. This leads to tristimulus theory that any color can be specified by 3 values. The following figure shows the spectral sensitivity functions of the cones and the luminous-efficiency function of the human eye. Slide: 4
4. Color Models A color model (or color space) is a way of representing colors and their relationship to each other. Example: How do you call/describe the following green colours? Is one model (RGB) enough? Why do we need different models? Slide: 5
Different image processing systems use different color models for different reasons. The color picture publishing industry uses the CMYK color model (explained later). Color CRT monitors and most computer graphics systems use the RGB color model. The range of colors that can be represented by a color model is known as a color space. Slide: 6
6. RGB Model (Red, Green, Blue) The RGB color space consists of the three additive primaries: red, green, and blue. Mixing of different coloured lights gives different colours : Red + green produces yellow. Green + blue produces cyan. Red + blue produces magenta. Slide: 7
The RGB model is represented by a 3-dimensional cube with red green and blue at the corners on each axis. Black is at the origin. White is at the opposite end of the cube. Typical color scheme used in graphics programming, image files, HTML etc. In a 24-bit color graphics system with 8 bits per color channel, R, G, B values typically all from 0-255 (so stored in 1 byte) Examples: orange is R=255 G=135 B=75 or (255, 135, 75) red is (255,0,0). Slide: 8
7. Color Depth Color depth refers to number of bits used to represent a color value. 8-bit : 256 colours 24-bit colour depth Slide: 9
8. Grayscale A grayscale image is formed by only using points in the RGB color space where R=G=B; i.e. diagonal in the RGB color cube from black to white. To convert an image from RGB color to grayscale, use grayscale intensity = (0.299R + 0.587G + 0.114B) / 3. Slide: 10
9. CMYK Model CMYK stands for Cyan, Magenta, Yellow, black -- the four colors that make up the standard printing process. The CMYK color model is a subtractive model. Slide: 11
Why the fourth color black is needed? Three primary colors, cyan, magenta, and yellow cannot produce a rich black, only a brownish color, so black ink is added as a fourth colour. CMYK inks printed in a dot structure Original full color photograph Slide: 12
10. HSV Model HSV stands for Hue, Saturation, and Value, and it uses these three concepts to describe a color. HSV is also HSB called (B for Brightness). You'll encounter it most often in illustration and image editing programs. Hue Hue is what most people think of when we say "color". Saturation Saturation is the "purity" of the color. It refers to the amount of gray paint mixed with the hue. Fully saturated colors are rich and bright. Less saturated colors look muddier, or less pure. Slide: 13
Value (Brightness) Value refers to the intensity of light present. When light is at its fullest intensity, colors will become bright, at its least intensity, colors become dim. Unlike saturation, there isn't necessarily "less" of the color -- it is just not as intense. Slide: 14
Varying saturation, with brightness held constant Varying brightness, with saturation held constant Slide: 15
Artists sometimes prefer to use the HSV color model over alternative models such as RGB or CMYK, because of its similarities to the way humans tend to perceive color. What color is it? How intense is it? How light or dark is it? Example - PowerPoint Slide: 16
11. The Colour Wheel Colour wheel - a popular representation of choosing colours. All the colours (hues) arranged in a circle Primaries equally spaced. Colours 180º apart complement each other Colours at 90º clash - don t use them Can use this to specify HSV. Hue=angleroundthecircle Saturation = distance from centre Brightness (V) = Gradation of centre grey shade Note: The artist color wheel uses RYB model. For computer display and printing, our discussion will base on the RGB model. Slide: 17
12. Four Color-Harmony Schemes The harmonious color combinations are called color schemes. There are 4 classic color schemes: Monochromatic Complementary Analogous Triadic Slide: 18
13. Monochromatic Color Scheme Monochromatic: colors of same or similar hue, differing in brightness and/or saturation The monochromatic scheme is easy to manage, and always looks balanced and visually appealing. Slide: 19
14. Complementary Color Scheme Complementary: colors approximately opposite each other on a color wheel The complementary color scheme offers stronger contrast than any other color scheme, and draws maximum attention. Slide: 20
15. Analogous Color Scheme Analogous: colors adjacent to each other, from any segment of a color wheel The analogous color scheme is as easy to create as the monochromatic, but looks richer. Slide: 21
16. Triadic Color Scheme Triadic: three colors approximately equally spaced around a color wheel The triadic color scheme offers high contrast while retaining harmony. Slide: 22
17. CIE Diagram The CIE's chromaticity diagram (shown below), developed in 1931. CIE diagram is still used as a standard reference for defining colors and as a reference for other color spaces. The CIE diagram is a plot of X vs. Y for all visible colors. Slide: 23
18. Comparison of Color Gamuts The gamut is the set of possible colors within a color system. No one system can reproduce all possible colors in the spectrum. Hence certain visible colors (e.g. pure yellow, pure cyan) cannot be seen on monitors The CMYK gamut is the smallest (but not a straight subset of the RGB gamut) Slide: 24
19. Colors in Video - YUV Model YUV refers to a color model that has one luminance (i.e. brightness) component (Y) and two chrominance (i.e., color) components (U = blue-y and V =red-y). YUV is a color model appropriate to color TV Why separate the color information separate from the luminance information? So that signals for black and white vs color TV are easily separated. Slide: 25
YUV is also a good representation for compression, because some of the chrominance (color) information can be thrown out without loss of quality in the picture. The Y axis is obtained from Y = 0.299R + 0.587G + 0.114B, signifying that green color contributes more to brightness. Digital Television uses different weights, and its format is called Y C B C R Slide: 26
20. YIQ Color Model YIQ is used in NTSC color TV broadcasting, it is downward compatible with B/W TV where only Y is used. Although U and V nicely define the color differences, they do not align with the desired human perceptual color sensitivities. In NTSC, I and Q are used instead. I is the orange-blue axis, Q is the purple-green axis. Slide: 27
Summary Color images are encoded as triplets of values. RGB is an additive color model that is used for light-emitting devices, e.g., CRT displays CMYK is a subtractive model that is used often for printers Four color-harmony schemes: monochromatic, complementary, analogous, andtriadic Two common color models in imaging are RGB and CMY, two common color models in video are YUV and YIQ. Besides the hardware-oriented color models (i.e., RGB, CMY, YUV, YIQ), HSV (Hue, Saturation, and Value) is also commonly used. Slide: 28