Advanced computer graphics colour
Download
1 / 44

Advanced Computer Graphics: Colour - PowerPoint PPT Presentation

Advanced Computer Graphics: Colour James Gain Department of Computer Science University of Cape Town jgain@cs.uct.ac.za Objectives To describe the human visual system and our perception of colour To introduce the physics of colour To cover a range of colour models and their relative merits

Related searches for Advanced Computer Graphics: Colour

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha

Download Presentation

Advanced Computer Graphics: Colour

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Advanced computer graphics colour l.jpg
Advanced Computer Graphics:Colour

James Gain

Department of Computer ScienceUniversity of Cape Town

jgain@cs.uct.ac.za

Advanced Computer GraphicsCollaborative Visual Computing Laboratory


Objectives l.jpg
Objectives

  • To describe the human visual system and our perception of colour

  • To introduce the physics of colour

  • To cover a range of colour models and their relative merits

Advanced Computer Graphics


What is colour l.jpg
What is Colour?

  • physical description:

    • a spectra of wavelengths.

  • psychological perception:

    • a stimulus sent from the optic system to the brain.

  • computer description:

    • different sets of bases and coordinates, depending on the type of display and application.

  • Problem:

    • How do we ensure that the different representations create the same visual effect?

Advanced Computer Graphics


Sight l.jpg
Sight

  • Arguably our principle modality.

  • An area of considerable research and development.

  • Components:

    • Wetware: The human visual system.

    • Hardware: Visual display systems (e.g. computer monitor).

    • Software: Rendering of 3D scenes (e.g. PSC).

  • Perceptual Terms:

    • Hue: Distinguishes among colours such as red, green, purple and yellow.

    • Saturation: Refers to how far a colour is from a grey of equal intensity. (How intense is the hue)

    • Brightness: the perceived intensity of a self-luminating object. (How much light is emitted). Alternatively, lightness refers to intensity from a reflecting object.

Advanced Computer Graphics


Human visual system l.jpg
Human Visual System

  • The lens of the eye forms an inverted image of the world on the back surface (retina) of the eye.

  • Cones:

    • 150000 per square millimeter in the fovea.

    • High resolution, colour.

  • Rods:

    • Lower resolution

    • monochromatic.

    • Peripheral vision: so we keep the high-res region in context and avoid being hit by passing branches.

  • Information is passed to the visual cortex (which performs extremely complex processing).

Advanced Computer Graphics


Visual cortex tristimulus reality l.jpg
Visual Cortex: Tristimulus Reality?

  • Types of Cones:

    • Low: 560 nmred ?

    • Medium: 530 nmgreen ?

    • High: 420 nmblue ?

  • Signal to brain:

    • L - M®red-green

    • H - (L+M) ®blue-yellow

    • L + M®red+green» overall luminance

  • Red/Green colour blindness means no signal L – M signal.

Advanced Computer Graphics


Hardware the ultimate display l.jpg
Hardware: The Ultimate Display

  • Ivan Sutherland’s “Ultimate Display” [1965] postulated a display which produced images indistinguishable from reality.

  • Requirements of ultimate Head Mounted Display (HMD):

    • Viewing distance: 10cm

    • Human visual acuity: 1’ ( ) of visual arc on average5” ( ) in the best-case

    • Field of View (FOV):Horizontal = 200 degVertical = 100 deg

    • Update Rate: 60Hz

    • Must also match other aspects of Human Visual System.

  • Required Flat Screen Resolution:

    • 1’ visual acuity requires 12000x6000 pixels

    • 5” visual acuity requires 144000x72000 pixels

Advanced Computer Graphics


Artists perception of colour l.jpg

Saturation

Tints

Tones

Brightness

Greys

Shades

Artists’ Perception of Colour

  • Artists mix white and black with pure colours

    • Tint = Pure colour + white

    • Shade = Pure colour + black

    • Tone = Pure colour + black + white

White

Pure

Colour

Black

Advanced Computer Graphics


Physics of colour colorimetry l.jpg
Physics of Colour: Colorimetry

  • Light is electromagnetic energy in the 400-760nm wavelength

  • Perceived as a spectrum of colours: violet, indigo, blue, green, yellow, orange, red.

  • Light energy, present simultaneously at each wavelength, is represented as a spectral energy distribution, P(l).

  • Physics vs. Perception:

    • Hue = dominant wavelength

    • Saturation = excitation purity

    • Brightness (self-luminous objects), lightness (reflecting objects) = luminance (amount of light)

    • Pure colour: a single highly dominant wavelength

Advanced Computer Graphics


Spectral distribution l.jpg
Spectral Distribution

  • One colour = one spectral energy distribution

Energy

P(l)

Wavelength

l

400 nm

Violet

760 nm

Red

Advanced Computer Graphics


Hue saturation and brightness l.jpg
Hue, Saturation and Brightness

Energy

P(l)

Dominant

wavelength

e2

Brightness =

area under

the curve

Saturation

e1

l

400 nm

Violet

760 nm

Red

Hue

Advanced Computer Graphics


Retina response l.jpg
Retina Response

  • Fraction of light absorbed by the three types of cones (R, G, B):

0.2

G

R

Light

Absorbed

B

l

0.0

760 nm

Red

400 nm

Violet

Advanced Computer Graphics


Retina luminous efficiency l.jpg
Retina Luminous Efficiency

  • The eye’s response to light of constant luminence with varying dominant wavelength.

  • Peak sensitivity (ability to resolve detail) is to yellow-green light.

100

Relative

Sensitivity

l

0

760 nm

Red

400 nm

Violet

Yellow-Green

550 nm

Advanced Computer Graphics


Colour definition l.jpg
Colour Definition

  • Define a colour by its spectral distribution:

    • Large memory requirements to create an adequate sampling of the distribution.

    • Dominant wavelength (hue) is not always immediately obvious.

    • Metamers: Different spectra with the same colour response. No uniqueness.

  • Need for simpler bases:

    • describing all colours

    • with a unique set of coordinates

Advanced Computer Graphics


Metamers l.jpg
Metamers

Same orange-like colour

Energy

P(l)

l

400 nm

Violet

760 nm

Red

Advanced Computer Graphics


Primary colours l.jpg
Primary Colours

  • Since our cones are sensitive to red, green and blue why not describe all colours as a linear combination of these primaries?

  • Below: value of three primaries required to match all wavelengths.

Values

V(l)

l

400 nm

Violet

760 nm

Red

Advanced Computer Graphics


Ci model l.jpg
CIÉ Model

  • Commission Internationale de l’Éclairage defined a colour model in 1931.

  • Three standard primary functions:

    • X, Y, Z

    • Defines all visible colours

    • Only positive coefficients

  • Y = retina luminance perception function

  • X and Y = chromaticity

Advanced Computer Graphics


Ci basis functions l.jpg
CIÉ Basis Functions

Values

V(l)

Z

Y

X

l

400 nm

Violet

760 nm

Red

Advanced Computer Graphics


Ci chromaticity diagram l.jpg
CIÉ Chromaticity Diagram

  • Project the CIÉ plane of constant luminosity (X+Y+Z=1) onto the X-Y plane.

Advanced Computer Graphics


Ci chromaticity diagram20 l.jpg
CIÉ Chromaticity Diagram

  • Colours on the horseshoe perimeter are fully saturated.

  • Complementary colours are those that can be mixed to produce white light.

  • Diagram factors out luminence so brown (orange-red at very low level luminance relative to its surrounding area) does not appear.

  • Dominant wavelength can be calculated by drawing a line from white through the colour and intersecting the perimeter.

  • Nonspectral colours (purple and magenta) intersecting the base of the horseshoe do not have a dominant wavelength.

Advanced Computer Graphics


Ci chromaticity perimeter l.jpg
CIÉ Chromaticity Perimeter

y

Green

520

540

560

Yellow

500

580

White

600

Cyan

Red

480

700

Purple

x

400

Advanced Computer Graphics


Ci chromaticity attributes l.jpg
CIÉ Chromaticity Attributes

y

Green

B

Yellow

A

D

Cyan

Red

C

E

F

G

Purple

x

Advanced Computer Graphics


Mixing colours l.jpg
Mixing Colours

y

Green

  • All colours on a straight line segment can be created by mixing the endpoints.

  • Similarly, colours within a triangle are a combination of the endpoints.

Yellow

I

Cyan

Red

J

K

Purple

x

Advanced Computer Graphics


Ci colour gamuts l.jpg
CIÉ Colour Gamuts

Monitor RGB Gamut

Film Gamut

x

Advanced Computer Graphics


Beyond ci 1931 l.jpg
Beyond CIÉ 1931

  • Equal steps across the Chromaticity Diagram do not equate to equal perceptual distances.

  • CIÉ 1976: perceptually uniform

  • LUV:

    • L for lightness

    • U and V for chromaticity

Advanced Computer Graphics


Computer description l.jpg
Computer description

  • Display device based colour-spaces:

    • RGB (monitor)

    • CMYK (printer)

    • YIQ (television)

  • Perception based colour-spaces:

    • HSV (user interaction)

  • Need to:

    • Correct for different display characteristics

    • Convert between colour models

Advanced Computer Graphics


Rgb colour model l.jpg
RGB Colour Model

  • Red, Green and Blue primaries.

  • Most well known colour space.

  • Used (internally) in every monitor.

  • Additive (colours added to a black background)

  • Black = (0,0,0), White = (1,1,1)

Advanced Computer Graphics


Cmy colour model l.jpg
CMY Colour Model

  • Cyan, Magenta and Yellow Primaries

  • Used (internally) in colour printers

  • Substractive (colours subtracted from a white background)

  • Black = (1,1,1), White = (0,0,0)

  • Complementary to RGB:

Advanced Computer Graphics


The rgb cmy cube l.jpg
The RGB/CMY cube

Blue

Cyan

Magenta

White

Black

Green

Red

Yellow

Advanced Computer Graphics


Cmyk colour model l.jpg
CMYK Colour Model

  • CMYK (Cyan, Magenta, Yellow, blacK)

    • Mostly for printer use

    • Saves on coloured inks by using black ink as far as possible

    • As a result dark colours dry more quickly

  • Converting from CMY to CMYK

    • Black is used instead of equal amounts of C, M, Y.

    • K = min(C,M,Y)

    • C = C – K

    • M = M – K

    • Y = Y – K

Advanced Computer Graphics


Yiq yuv colour model l.jpg
YIQ, YUV Colour Model

  • U.S. commercial television broadcasting

  • Recoding of RGB for:

    • Transmission efficiency

    • Backward compatibility with Black and White TV (drop I and Q)

  • YIQ = NTSC

    • Y is luminance

    • I and Q are chromaticity

  • YUV=PAL

  • Exploits visual system:

    • More sensitive to changes in luminance (Y) than chromaticity (I and Q) -> more bandwidth for Y

    • Objects covering a small field of view produce limited colour sensation -> either I or Q can have lower bandwidth.

    • Ratio Y:I:Q = 4:1.5:0.6

Advanced Computer Graphics


Hsv colour model l.jpg
HSV Colour Model

  • Hue, Saturation and Value Primaries

  • Cylindrical co-ordinate system:

    • Hue (H = 0 – 360 deg) rotation

    • Saturation (S = 0.0 – 1.0) radius

    • Value (V = 0.0 – 1.0) height

  • User oriented and based on the intuitive appeal of artist’s colours (hue, tint, shade).

  • Represented by a hexcone.

Advanced Computer Graphics


The hsv cone l.jpg
The HSV cone

Green

Yellow

Cyan

Red

White

Blue

Magenta

Black

Advanced Computer Graphics


Hsv conversion l.jpg
HSV conversion

  • Flatten RGB cube along the diagonal to create HSV hexagon

  • There is an algorithm for converting in both directions

  • RGB to HSV:

    max = max(r,g,b); min = min(r,g,b)[

    V = max

    S = (max-min)/max

    H = more complicated

Green

Yellow

Red

Cyan

Blue

Magenta

Advanced Computer Graphics


Hsv properties l.jpg
HSV properties

  • Interpolating Colour:

    • Linear interpolation of the same two colours in RGB, CMY, YIQ and CIE all produce the same result. Appropriate for Gouraud shading

    • Not true for HSV. But interpolating between colours while keeping Hue, Saturation or Value constant is obviously easier.

  • Effective for visualization:

    • change saturation, at constant hue

    • change hue, at constant saturation (maps)

Advanced Computer Graphics


Colour fidelity l.jpg
Colour Fidelity

  • Problem: ensure that colours look the same when changing display devices

    • Sample the RGB phosphors with colorimeters

    • Sometimes device description are available from manufacturers

  • Convert to XYZ space:

  • From XYZ to device dependent RGB uses the inverse.

Advanced Computer Graphics


Intensity perception l.jpg
Intensity Perception

  • Human perception of intensity is logarithmic:

    • Sensitive to ratios of intensity levels not absolute steps

    • I = 0.1 to 0.11 has same as I = 0.5 to 0.55

    • Cause of Mach-Banding

    • Need more steps at lower intensity levels

  • CRT intensity related to voltage:

    • Constants depend on the particular CRT

  • Gamma Correction: lookup table which correct for both hardware and perceptual issues with intensity.

  • Can lead to strange effects if forgotten. Transferring a picture between monitors with different gamma values causes problems.

Advanced Computer Graphics


Displaying colours l.jpg
Displaying colours

  • Colour ability of the display

    • measured in bits:

      • 1 bit=2 levels, 8 bits=256 levels

    • bits per colour primitive:

      • 24 bits=256 levels for each of R,G,B

  • Depends on the medium:

    • TV Screen: 30 dpi, 8bits colour

    • Computer Screen: 70-100 dpi, 24 bits colour

    • Laser Printer: 300-2400 dpi, 3 bits colour (8 colours)

    • Photo: 800 dpi, 36 bits colour

Advanced Computer Graphics


Gaining colour resolution l.jpg
Gaining colour resolution

  • Sometimes, this colour resolution is not enough. How do we display more colours?

  • Basic idea:

    • Sacrifice some of the spatial resolution for intensity resolution

    • Halftoning and dithering

  • Halftoning:

    • For top quality printers

    • Discs of size varying inversely with Intensity

    • Pattern angle (called screen angle)

    • Halftone resolution (different from spatial resolution)

    • 60-80 dpi for newspapers, 120-200 dpi for books

Advanced Computer Graphics


Dithering l.jpg
Dithering

  • Used if halftoning is not possible (because of the wrong type of printer or use of a monitor)

  • Dither patterns

    • Group of n*n pixels = n*n+1 intensity levels

    • 2x2 example:

    • Matrix notation:

0

1

2

3

4

Advanced Computer Graphics


Dithering properties l.jpg
Dithering Properties

  • For level i, display pixels with v < i

  • Requirement of matrix:

    • Don’t produce visual artefacts (e.g. straight lines)

    • Growth sequence (minimizes differences in nearby areas)

    • dispersed dots for CRT, clustered dots for printers

Advanced Computer Graphics


Dithering the next step l.jpg
Dithering: the next step

  • One image pixel = 4 or 9 printer pixels

  • What if I want one image pixel = one printer pixel?

  • Use modulo:

    • i = x modulo n

    • j = y modulo n

    • Light the pixel if value (i, j) in dithering matrix is smaller than I(x, y)

  • Error diffusion:

    • There is an error at each pixel

    • Dithering pattern is sometimes visible

    • Floyd-Steinberg error diffusion spreads the error to neighbouring pixels

Advanced Computer Graphics


Using colours in cg l.jpg
Using Colours in CG

  • Meaningless colours reduce performance by up to one third.

  • Design colour schemes first in monochrome. This does not prejudice the colour blind.

  • Aesthetics: Use even perceptual steps between colours, complementary colours, even intensities.

  • Using colours for codes can have unintended meanings.

  • Perception:

    • Colour of area is affected by surroundings.

    • Colours seem to advance (red) or recede (blue).

    • Blocks of the same size in different colours appear to have different sizes (red > green)

Advanced Computer Graphics


Conclusion l.jpg
Conclusion

  • Several ways to represent colours. Each one suited to a specific task:

  • Conversion between colour models is often required:

    • for colour fidelity (convert to CIE and back to device-space)

    • for displaying the image in a different medium

  • But remember colour is heavily influenced by our perceptions!

Advanced Computer Graphics


ad
  • Login