image encodings

12
CSC 1040 - Computing with Images 1 Image encodings CSC 1040

Upload: geri

Post on 15-Jan-2016

30 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Image encodings

CSC 1040 - Computing with Images 1

Image encodings

CSC 1040

Page 2: Image encodings

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

Page 3: Image encodings

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

Page 4: Image encodings

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.

Page 5: Image encodings

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

Page 6: Image encodings

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

Page 7: Image encodings

CSC 1040 - Computing with Images 7

Color:(108,86,142) Position: (12,9)

x = 12

y = 9 red=108 green=86 blue=142

Page 8: Image encodings

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:

Page 9: Image encodings

CSC 1040 - Computing with Images 9

Let’s practice making these colors in Photoshop

Page 10: Image encodings

Dimensions of color

CSC 1040 - Computing with Images 10

Source: http://www.huevaluechroma.com/012.php

Page 11: Image encodings

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

Page 12: Image encodings

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