120 likes | 245 Views
Image encodings. CSC 1040. What’s a picture?. We have seen that programs represent pictures as grids of picture elements or pixels. Stephanos with his eraser collection. Pixel encodings. RGB Color 3 colors: red, green, blue 8 bits/color 24 bits. Bitmap 1 bit. Grayscale 8 bits.
E N D
Image encodings CSC 1040 CSC 1040 - Computing with Images
What’s a picture? • We have seen that programs represent pictures as grids of picture elements or pixels Stephanos with his eraser collection CSC 1040 - Computing with Images
Pixel encodings • RGB Color • 3 colors: red, green, blue • 8 bits/color • 24 bits • Bitmap • 1 bit • Grayscale • 8 bits CSC 1040 - Computing with Images
Additive color model: RGB • In RGB, a color has three component: • R: Amount of redness • G: Amount of greenness • B: Amount of blueness • These values are usually represented by numbers in the range 0…255 • Additive color model: Based on the way the light mixes on a computer screen. It is called an additive color model because if you add the three primaries (red, green and blue) together, you get pure white light. CSC 1040 - Computing with Images
Subtractive color model: CYM • In CYM, a color has three component: • C: Amount of cyan • Y: Amount of yellow • M: Amount of magenta • Usually numbers in the range 0…255 • Subtractive color model: CMY is based on the way translucent inks combine to block light – thus “subtracting” light. • In reality you need to add pure black ink (“K”) to get real black – therefore CYMK CSC 1040 - Computing with Images
Encoding RGB • Each component color (red, green, and blue) is encoded as a single byte • Colors go from (0,0,0) to (255,255,255) • If all three components are the same, the color is in greyscale • (50,50,50) at (2,2) • (0,0,0) (at position (1,2) in example) is black • (255,255,255) is white CSC 1040 - Computing with Images
red=108 green=86 blue=142 y = 9 Color:(108,86,142) Position: (12,9) x = 12 CSC 1040 - Computing with Images
Additive/Subtractive Color We choose 3 primary colors that can be combined to produce most (but NOT all) the visible colors: • Additive primaries (Combining light): RedGreenBlue • Subtractive primaries (combining ink, thus subtracting light):CyanYellowMagenta CSC 1040 - Computing with Images
Let’s practice making these colors in Photoshop Additive primaries • Start with black background, • use a hard edged brush of large diameter and set mode to “Lighten” • Apply red, green, blue Subtractive primaries • Start with white background, • use a hard edged brush of large diameter and set mode to “Darken” • Apply cyan, yellow, magenta CSC 1040 - Computing with Images
Dimensions of color Source: http://www.huevaluechroma.com/012.php CSC 1040 - Computing with Images
Color in the eye: What does one million colors look like? • This image (when viewed in full size, 1000 pixels wide) contains 1 million pixels, each of a different color. • The human eye can distinguish about 10 million different colors. • Source: Wikipedia commons CSC 1040 - Computing with Images
The color gamut Not all visible colors can be produced by any 3 primaries! • The color gamut refers to the range of colors for a particular color system Source: http://dx.aip.org/advisor/cmyk_color.html CSC 1040 - Computing with Images