Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s...

57
Color

Transcript of Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s...

Page 1: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Color

Page 2: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

What is Color?

• Color is merely a concept, something we “see” within our minds– It’s interpretation involves both physics and biology

– How would you describe the color “red” to a blind person?

• Clearly, it plays a useful role in everyday life• Thus, building a mathematical description of color

may also prove useful

Page 3: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Color is Complex

• “Standard” mathematical models began in the early 20th century and have evolved (and evolved, and evolved…)

• Confusion arises in that the early standards are not discarded as the evolution takes place– Today, “old” and “new” standards live side by side

• Thus, when discussing color the first thing the participants must agree upon is the standard in which they are basing their discussion

Page 4: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Standards

• Based on a tristimulus system of additive primaries

• Tristimulus – three primary colors

• Additive – all other colors can be created by adding different proportions of the primaries

Page 5: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Preliminaries

Page 6: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Tristimulus, Additive Primaries

• Red, Green, and Blue primaries were agreed upon based on a normal human visual system

• A normal visual system consists of the eyes and sections of the brain, all operating properly– Color blindness is due to a deficiency in one type of

cone – very common in males• Red and green receptor genes are carried on the X

chromosome, and these are the ones that typically go wrong

• Women need two bad X chromosomes to have a deficiency, which is less likely

Page 7: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Eye

Page 8: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Retina

• The retina contains two types of light sensors– Rods that are highly sensitive to light and provide us

with “night vision”• Located primarily in the outer (non-foveal) region of the retina

– Cones that are highly sensitive to color and provide us with “color vision”

• Located primarily in the central (foveal) region of the retina

• Are adaptive to ambient light

• Are susceptible to optical illusions

• Color illusion

Page 9: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Retina

• There are 3 types of cones contained within the retina– Red-sensitive (long)– Green-sensitive (medium)– Blue-sensitive (short)

Page 10: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cone Sensitivity(probable)

Page 11: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Visual System

• Once the eye has sensed the color it is up to the brain to interpret it

• This is where things get very complex and relatively little is known about the actual inner-workings

Page 12: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Visual System

Page 13: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

So What?

• With what we know (or think we know) about the visual system, we now try to develop useful models to support the more mundane tasks of everyday life

Page 14: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Standards

Page 15: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Standard Observers

• To set a standard a group of people were shown color patches of a given size and asked “what colors they saw”– Match color by

adjusting primaries

• Results were averaged and thus the standards were created

Page 16: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Standard Observers

• 1931 (2°) and 1964 (10°) standard observers

Page 17: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

The Color Spaces

Mathematical Descriptions of Color

Page 18: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

CIE Color Spaces

• Used primarily for matching/comparing colors• Various different forms of charts• Charts were made using “standard observers”

– Groups of people with “normal” color vision– Ties wavelengths to colors– Can specify coordinates to compensate for monitor

characteristics

• There are numerous versions of the CIE color space based on differing observer parameters and differing basis standards

Page 19: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

XYZ Color Space (the grand-daddy of them all)

• Combine– Known illuminant

– Colors on known (non-reflective) material

– Standard observer

– The result is a tristimulus space for describing colors

– XYZ cannot be visualized directly

Page 20: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

xyY Color Space(the first offspring)

• Since there’s no good way to visualize the XYZ color space…

• The xyY space is a normalized (projected) version of XYZ– x and y correspond to normalized X and Y respectively (projected

onto a plane where the RGB cube is mapped to XYZ space)

– The luminance (black/white level) is lost in the normalization process so Y (which is luminance and not the same Y as in XYZ space) in xyY is also computed from XYZ

– z is not needed since the normalization process constrains x + y + z = 1

Page 21: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

xyY Color Space(well, one of them anyway)

Monochromatic(saturated)

Colors

MonitorGamut Line of Purples

(not monochromatic)

Planckian (blackbody)Locus

Single Wave Lengths

(400nm to 780 nm)Mixed Wave

Lengths

Page 22: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

xyY Color Space

• Pro– We can visualize the XYZ standard– We can visualize the proximity of one color to

another

• Con– The space is non-uniform so we cannot use it to

compare colors

Page 23: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Other Useful Color Spaces

• What do we know?– Color spaces should be tristimulus– XYZ and xyY are not very intuitive– We need something to suit our [varied] needs

• So, we invent new color spaces

Page 24: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Color Space

• RGB is a linear color space– Pure red, green, and

blue are the basis vectors for the space

– Useful for cameras, monitors, and related manipulations (of light)

Gray (black to white) axis

Black

White

Page 25: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Color Space

Back Surfaces Front Surfaces

Page 26: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Operations

• Color mixing is performed by vector addition and subtraction operations– Adding/subtracting colors is the same as

adding/subtracting vectors (with clamping at 0)

red green+ yellow=

Page 27: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Operations

• Increasing or decreasing luminance is performed by scalar multiplication– Same as scalar multiplication of vectors (with

clamping at some maximum)

yellow 2* brighter yellow=

Page 28: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Operations

• A word of caution…• Operations must be clamped…

– …at 0 to make sure components don’t go negative– …at some pre-specified maximum to ensure display

compatibility

• Scaling down from a value greater than the allowed maximum can be performed but care must be taken– Bright colors may end up less bright than other colors in the

scene– The answer is to scale ALL colors in the scene which can be

expensive

Page 29: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Color Space

RGB

Red

Green

Blue

Page 30: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

RGB Color Space

• Pro– Very intuitive and easy to manipulate when generating

colors

– Works well with hardware (light related)

• Con– Very unintuitive when it comes to comparing colors

• Consider the Euclidian distance between red and green and between green and blue

– Bad for some applications

Page 31: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces (there are many)

• Luminance channel– Corresponds to the black and white signal of a color

television

• Two chrominance channels– Red and blue

– Correspond to the color signal that “rides” on top of the black and white signal of a color television

• Various forms– YUV, YIQ, YCbCr, YPbPr…

Page 32: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces (there are many)

• Luminance is a square wave• Chrominance is a sine wave (modulation) on top

of the square wave

Page 33: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces (there are many)

• Simple conversion from RGB and YPbPr

• And from YPbPr to RGB

PPY rb

B

G

R

081.418.500.

500.331.168.

114.587.299.

BGR

Y

PP

r

b

000.0772.1000.1

714.0344.0000.1

402.1000.0000.1

Page 34: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces

RGB

Luminance

ChrominanceBlue

ChrominanceRed

Page 35: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces

• Pro– Separate high frequency components from low frequency

components– Easy to compute (fast in hardware)– Facilitates image compression (JPEG, MPEG)– Good for various applications (e.g. face detection, shadow

detection…)

• Con– Not very intuitive– Requires signed, floating point (or scaled) representation– Multiple forms causes confusion (e.g. people regularly confuse

YCbCr with YUV)

Page 36: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Luminance-Chrominance Color Spaces

• Note that there are various different matrices for these conversions– Based on different needs– Be careful about the one you select

• Chrominance channels are +/- so to display you must translate and scale

Page 37: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Compression(uses for luminance/chrominance)

• Trade-off between the amount of data and the quality of the picture– Throw away as much data as possible without

degrading the picture– JPEG, MPEG, …

Page 38: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

JPEG/MPEG

• The edge/structure detail is contained in the luminance channel– This is referred to as “high frequency” data

• The color information is in the chrominance channels which are lacking edges/structure detail– These are referred to as “low frequency” data

Page 39: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Color Image (RGB)

Page 40: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Y Channel (high frequency)

Page 41: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cb Channel (low frequency)

Page 42: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cr Channel (low frequency)

Page 43: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Subsampling

• By subsampling we achieve a 2:1 compression without doing any “work”– This is the default mode for MPEG– The default mode for JPEG is to subsample in 1

dimension only so it’s 3:2 compression without doing any “work”

• The decompressed image still looks good because of the low frequency nature of the chrominance channels

Page 44: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Subsample Cb and Cr (mpeg mode)

Page 45: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

MPEG/JPEG

• There’s a lot more processing involved but they’re not specific to the chosen color space

Page 46: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cyan-Magenta-Yellow-blacK

• Used in printing• Colored pigments (inks) remove color from

incident light that is reflected off of the paper

• CMYK is a subtractive set of primaries– K (Black) is not actually necessary but is added

for practical printing applications

• CMYK is a linear color space

Page 47: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cyan-Magenta-Yellow-blacK

Cyan Magenta

Yellow BlackRGB

Page 48: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Cyan-Magenta-Yellow-blacK

• Pro– Good for printing (as long as you include the K

ink)

• Con– Difficult to convert from RGB to CMYK as it

is not a simple subtraction from white if high accuracy is required

Page 49: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Hue/Saturation/Lightness

• Also Hue/Saturation/Value or Hue/Saturation/Intensity

• Suitable to processing images for “human consumption” (viewing)– Easy to make colors more “vibrant” (and other

features that we can name but can’t really describe)

– Used in artistic endeavors

Page 50: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Hue/Saturation/Lightness

• Hue is the pure color content– Corresponds to the edges of the RGB cube

• Saturation is the intensity of color – The faces of the RGB cube are fully-saturated

• Lightness is the brightness of the color– Ranges from black to white

Page 51: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Hue/Saturation/Lightness

• Mapping the RGB cube to a hex-cone

Page 52: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Hue/Saturation/Lightness

RGB

Hue

Saturation

Lightness

Page 53: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Hue/Saturation/Lightness

• Pro– Captures the “human” qualities of color

• Con– Difficult to describe– Difficult to compute

Page 54: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

L*a*b* Color Space

• While convenient for various reasons, the previous color spaces are not great for comparing colors– Most attempts treat the colors as a 3-vector and try to do

some modified Euclidian distance measure and some sort of clustering algorithm

– But, the color spaces are non-uniform

• La*b* is a uniform color space– A small perturbation in a color component is equally

perceptible across the entire range

Page 55: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

L*a*b* Color Space

RGB

L*

a*

b*

Page 56: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

L*a*b* Color Space

• Pro– Uniform space– Colors can be compared [accurately] using the Euclidian

distance formula

• Con– Not very intuitive– Not easy to convert from/to RGB

• Requires knowledge of a reference white• Requires computation of cube-roots

Page 57: Color. What is Color? Color is merely a concept, something we “see” within our minds –It’s interpretation involves both physics and biology –How would.

Summary

• Color is complex

• The human visual system is complex and very good at processing light

• Together they comprise a system that we aren’t even close to understanding but utilize very effectively