CS3500 Computer Graphics

Module: Colours etc.
P. J. Narayanan Spring 2005

CS3500

1

Story so far ...
3D Graphics involves projecting the 3D world to the 2D image plane of the camera. Involves a series of rigid transformations. Complex objects/environments are described in their own coordinate systems. Modelling places them in a world coordinate system. This could involve a hierarchy of transforms for objects made up of complex parts. View Orientation computes the world in the VRC. This gives the relative geometry of the world with respect to the camera.
February 10, 2005
       

CS3500

2

Camera can be perspective or parallel, defined by 6 planes. View Mapping or Normalizing Transformation maps VRC to an orthographic canonical view volume. Different for parallel and perspective cameras. Projection is easy to perform here. dimensions from -1 to +1 results. An image with

CS3500

         

Viewport transformation scales and translates in 2D to map to window coordinates (or frame buffer address). Points of 3D primitives map to points of 2D primitives. Scan-convert using standard algorithms.
February 10, 2005

3

Rendering Pipeline

Modelling
Object Coords

View Orientation
World Coords

View Mapping

Clipping
Canonical View Volume

Viewport
Normalized 2D Coords Screen Coords

Camera Coords

CS3500

February 10, 2005

4

What after scan conversion?
What do we write into the frame-buffer after identifying which pixels belong to a primitive? The colour and intensity! Colour represented using Red, Green, and Blue. Why? What about black/white/gray level? What are the basics we need to know to design a good Graphics system/application?
February 10, 2005
         

CS3500

5

Light
Light can be two types: Achromatic (without colour) or Chromatic (coloured) White (and gray) light contains all wavelengths. Coloured light has a dominant wavelength. White light can be split into VIBGYOR components by passing through a prism.
     

CS3500

February 10, 2005

6

Visible Spectrum
Visible portion of the electromagnetic spectrum is what we are interested in. From about 400nm (Violet) to 700nm (Red). Human sensitivity (luminous efficiency) is different for different wavelengths: Peak is around 550nm (Green).
     

CS3500

February 10, 2005

7

Some Terms
Radiance: Light energy emitted by the source. Luminance: Light energy that reaches the sensor. Brightness: Perceived intensity or energy. Lightness: Perceived intensity or energy of a reflecting object.
       

CS3500

February 10, 2005

8

A Monochrome Display System
Number of different intensities: n+1 (say, 256). : lowest intensity to be displayed. Highest is 1.0 = .
 
CS3500
           

 

¢

Human eye is sensitive to intensity ratios (logarithmic to is same as to ). response). (i.e,
¤£ ¥ ¤£ ¥¦ ¤£ ¤£ § ¨

Thus,

Intensities for each level (index): . Or,
$ %¢ ¢ ! "#  © & ! ©    ¡ ¡ !   © () '

¡

. Thus,

. .
¢    ¡ 

¢   

¢ ©    ¢ ¡   ¥¤ ©

© £ ¥¤  

 

£

¡  

    ¡        ¡    !
February 10, 2005

    

¡

.

¡

0

1 

9

CRT Monitor and Gamma Correction
Dynamic range ( and
©
¦

,

) is between 40 and 200. For , and .
© ¥¤ ¥  £ §

©

CS3500

         

¥¤ £  ©

 

 

¡

©

¦

 

¤£

¦£

  ¨ ©§

¡

CRT’s response is non-linear. , the voltage. Thus,
©  

§ 

£

§

§

¡

,

and

: #electrons .
¤   

¤

©  
¤ £¢

£

©

 

¥

¦

¦ 

for CRTs.
'

needn’t double to double !
 

For each index , supply For a given ,
 

¦ § 

¤¦

¦

¤

round

¦

to the CRT. . .
¤   

¤   

   !

© '

©

1 0 () 

 

  ¡  

 

¦ 

!
February 10, 2005 

10

How Many Intensity Levels?
Successive levels should be continuous, without edges.
     

From experiments, this means: . Therefore ,
¢ ©
CS3500

. So use .

.

¤¥  £
 

¥

¤¥ £

¥

©

¥¤ £ 

The edges between levels not visible if this is satisfied.
February 10, 2005

¥

¥

 

()
¡ 

¡    ¥ ¡

¡

0

¡

11

Typical values for different media (dynRange) :
¡

CS3500

     

CRT (50-200) 400-530 Slides (1000) 700 Newspaper (10) 234

Prints (100) 465 Coated paper (100) 465

In practice, fewer will suffice due to ink/light smearing. 256 levels have become a standard because it is good enough and convenient for byte-oriented computers!!

February 10, 2005

12

Halftone Approximations
Use spatial integration to simulate intensity levels on bilevel display/hardcopy devices. Halftoning (clustered-dot ordered dither): Print with in a small resolution unit. blackness
  ¡
       

¥

 

levels using

¥ 

pixels. (5 levels with
¥ ¤

pixels) .
¥

CS3500 

¡

£¡

£

¥
¢

¦

¦

Dither Matrix: turn on pixels
¨ 

¡

to display blackness  

A

dither matrix:

§ 

£¦ ¦

¥ £
¨ ¦

¦ §
©  

February 10, 2005

13

Basics of colour
A bulb appears red if it emits light of in the red range.
         

A flower appears yellow because it absorbs light of all wavelengths except in the yellow range. Pure colours have a particular . Mixed colours have light of different wavelengths. Different perceptual colours have different spectral energy distributions. Different spectral distributions might “look” the same! (Called metamers).
February 10, 2005
 

 

CS3500

14

Description of colour
Colour perception in terms of: Hue, Saturation, Value. Hue: Pure colour or dominant wavelength. Saturation: How far from white/gray or excitation purity. Value/Intensity; The intensity/brighness or luminance. In artists language: Mix black to a pure color to get its shades. Mix white to get its tints. Mix black and white to get grays. Mix all three to get tones.
February 10, 2005
         

CS3500

15

G C B

V W

Y R M

H B
CS3500

S
February 10, 2005

16

Human Colour Perception
Our retina has rods and cones. Rods see gray levels an cones see colour. Our retina has 3 types of cones: Red, Green, and Blue. Their spectral responses respectively peak approximately at 580nm, 545nm, and 440nm. Luminous efficiency (to constant luminance light) of the eye is a bell-shaped curve with a peak at about 550 nm.
February 10, 2005
       

CS3500

17

CS3500

February 10, 2005

18

CS3500

February 10, 2005

19

Tristimulus Theory
All perceivable colours can be specified as weighted combination of primary colours R, G, and B. RGB define a set of basis vectors. Mix them in different measures to get any colour. Attractive, because a compact representation is possible. Problem reduces to: Find the values of R, G, B to produce a given perceptual colour.
February 10, 2005
       

CS3500

20

Colour Matching
Computing the weights of R, G, B for a given colour. Colour Matching Functions: distribution of weights for RGB to match a given wavelength. Unfortunately, has negative values for red in the 450-550nm range. Negative values are not 0 convenient for a device like CRT, which can’t “take away” red.
February 10, 2005
       

B G

R

CS3500

21

CIE XYZ Colour Model
A model called XYZ was standardized by the CIE in 1931. All colour-matching functions are positive for them. Colour-matching function of Y was designed to match the luminous efficiency function of the eye. Colour . .
¢
¨
         

©
¡¢ £¢ ¤ ¥¢ ¦   ¡ £ ¥

Chromaticity values defined by by their sum. Thus, dividing 


Obtained by .
© ¥
February 10, 2005

§

©  

¨ § 

¢

©

CS3500

22

CIE Chromaticity Diagram
A tongue-shaped diagram with pure colours along the plane). periphery. (CIE space cut by the
© ¥
         

Line between two colours obtained by mixing them. “‘White” point lies close to .
© ¥
§ ©

§

©

¢

¢

¨

©
¦
¨

Extend the line from white to any colour to the periphery. Hue is the point on periphery and Saturation is the ratio of distances from white to colour and peripheral point. Complementary Colours: Mix to form white.
February 10, 2005

© 

CS3500

23

CS3500

February 10, 2005

24

RGB Colour Model
Called the Additive Primaries. Colour Cube: R+G = Yellow, R+B = Magenta, G+B = Cyan, R+G+B = White, all zero gives Black. Popular in graphics, as it is relevant for CRT Monitors. Commonly, values are normalized to the range .
¤£ ¥¤ £ £
            

Grays lie along the diagonal from (0, 0, 0) to (1, 1, 1).
February 10, 2005

CS3500

25

B M B R Y W

C

G

CS3500

February 10, 2005

26

CMY(K) Colour Model
Called the Subtractive Primaries. Colour Cube: C+M = Blue, C+Y = Green, M+Y = Red, C+M+Y = Black, all zero gives White. Subtract RGB from 1.0, you get CMY, respectively. Since black is common, is taken out as black or K component. Yields the CMYK colour model used in the 4-colour printing process.
£
       

 ¡

¢

£ ¤    

CS3500

February 10, 2005

27

Interpolating in Colour Space
Simple, affine, transformation matrices between RGB, CMY, YIQ, YUV, spaces. Lines in one colour space map to corresponding lines in the other space. Thus, colour interpolation can be performed in any space. Lines in RGB space map to something else in HSV space. Interpolating HSV values is not valid.
February 10, 2005
         

CS3500

28

Colour in Computer Graphics
Tasteful use is mandated. Overuse and arbitrary use take away from the message. Golden rule: Less the better!. Colour can effectively enhance the message. Perceptual distance between colours is not the same as the RGB distance! Blues appear far and reds near. Unwise to use red for background and blue for foreground.
February 10, 2005
         

CS3500

29

End of Class 18

CS3500

February 10, 2005

Sign up to vote on this title
UsefulNot useful