Image encodings
description
Transcript of Image encodings
CSC 1040 - Computing with Images 1
Image encodings
CSC 1040
CSC 1040 - Computing with Images 2
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 3
Pixel encodings
Bitmap
1 bit
Grayscale
8 bits
RGB Color 3 colors: red, green, blue
8 bits/color
24 bits
CSC 1040 - Computing with Images 4
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 5
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 6
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 7
Color:(108,86,142) Position: (12,9)
x = 12
y = 9 red=108 green=86 blue=142
CSC 1040 - Computing with Images 8
Additive/Subtractive ColorWe choose 3 primary colors that can be combined to produce most (but NOT all) the visible colors:We choose 3 primary colors that can be combined to produce most (but NOT all) the visible colors:
CSC 1040 - Computing with Images 9
Let’s practice making these colors in Photoshop
Dimensions of color
CSC 1040 - Computing with Images 10
Source: http://www.huevaluechroma.com/012.php
Color in the eye: What does one million colors look like?
CSC 1040 - Computing with Images 11
•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
The color gamutNot all visible colors can be
produced by any 3 primaries!
• The color gamut refers to the range of colors for a particular color system
CSC 1040 - Computing with Images 12
Source: http://dx.aip.org/advisor/cmyk_color.html