Title: Color
1Color
2Electromagnetic Radiation
- Visible light (for humans) is electromagnetic
radiation with wavelengths in the approximate
interval of 380-780 nanometers
3Colour
colour depends on The surface of the object
being viewed Lighting conditions The way our
eyes collect light The way our brain interprets
the signals Colour is often associated with the
wavelength of light
4Color PerceptionHow is color perceived?
- Color is the eyes and the brains impression of
electromagnetic - radiation in the visible spectra.
- 1 Light source
- 2 Reflecting object(s)
- 3 Light detector(s) (sensitive for red, green,
blue) - Patrick (Uppsala University) Color
5Color Perception Light properties
- Illumination
- Achromatic light - White or uncolored light
that contains all visual wavelengths in a
complete mix. - Chromatic light - Colored light.
- Monochromatic light - A single wavelength, e.g.,
a laser. - Reflection
- No color that we see consists of only one
wavelength - The dominating wavelength reflected by an object
decides the color tone or hue. - If many wavelengths are reflected in equal
amounts, an object appears gray.
6Physiology of the EyeThe eye, rods, and cones
- Radiance - The total amount of energy emitted
from a light source - Luminance - Amount of light an observer
perceives, i.e., excludes non-visible energy - Brightness - A subjective descriptor corresponds
to achromatic intensity).
7ReceptorsThe rods
- Sense luminance, or brightness, but not color.
- The rods are spread out across the whole retina,
and dominate - when the pupil is large, i.e., night vision. Less
color is seen at night. - The response is not linear, but logarithmic.
- The appearance of an objects intensity depends
on the surroundings the sensation is relative
and not absolute
8ReceptorsThree kinds of cones
- In order to standardize the description of color,
a large number of people were instructed to say
what combination of basic colors a certain color
sample consisted of in standard lighting. This
resulted in the color matching curves, i.e., the
transform - r () Red-sensitive (65)
- g() Green-sensitive (33)
- b() Blue-sensitive (2)
- Patrick
9Tristimulus valuesCIE Color space
- Each color is represented by a point (X, Y, Z) in
the 3D CIE - Color space. The point is called a tristimulus
value.Patrick
10Chromaticity spaceThe chromaticity diagram
- The projection of X Y Z 1 creates the
CIE-YXZ chromaticity diagram. - Wavelength along the edge.
- CIE standard white when x y z.
- It is not possible to produce all colors by
mixing three primary colors.
11CIE colour model
CIE International commission on colour Sets
standards for colour pigments and displays CIE
colour space is based on physical properties of
light A CIE colour has three components The
intensity or luminance (similar to value in HSV)
2 colour co-ordinates x and y (similar to H
and S together in HSV This model colour
developing in relation to the wavelengths
12The CIE Chromaticity Diagram
This shows how colour relates to x and y values
It has a sail shape Around the edge of the sail
the wavelength of light increases
13Description of color using color models
- Example of color models
- Color models or color spaces are usually a
subspace in a 3D system where each color is
represented by a point. - Hardware oriented color models
- RGB
- CMY
- YIQ
- Color image manipulation and color matching
- HSI
- NCS
- Patrick
14RGB colour model
- The RGB Colour model is an three primary colour
red, green, and blue - It is linked to the way our eyes work
- It is used for colour displays such as
computer monitors, televisions, etc. - Other colours are made by mixing these together
- These are colours of light rather than pigments
15RGB-Space
- RGB colours can be seen as a 3D space
- The axes are red, green, and blue
- All the colours you can make lie in a cube
- extending from the origin (black)
- The diagonal from black color to white color
represent gray color
16RGB Color model
- Where (0, 0, 0) is black, and (1, 1, 1) is
whitePatrick
17RGB permutation
18RGB permutation
- Three 8-bit images produces new 24-bit color
images
19Safe colorsWeb palette
- A subset of colors that are likely to be
reproduced faithfully independent of hardware
capabilities. - Coded using hexagonal number system Each of R,
G, and B may only have intensity 0, 51, 102, 153,
204, or 255, or 00, 33, 66, 99, CC, or FF in hex. - Thus, black is 000000, red is FF0000, and yellow
is FFFF00.
20RGB Example
An RGB image, along with its separate R, G and B
21Colour Image
- When written, RGB values in 24 bits per pixel
(bpp), also known as True colour, are commonly
specified using three integers between 0 and 255,
each representing red, green and blue
intensities, in that order. - But true color image size is big since each pixel
will represent by 3 bytes - So we used Colour palettes to reduce the amount
of data at each pixel - Each pixel value is 8 (1 byte ) which is an index
to the palette ( the number of color will be
represented her is only 256 different color).
22Greyscale
- Sometimes we want a single value at each pixel
- Makes processing easier
- Reduces the amount of information
- Makes some of the theory simpler
- This value is usually the intensity or grey
value - We can compute the grey value using a simple
average of red, green, and blue - But our eyes are more sensitive to green light
so... - We can convert an RGB image to greyscale using
- i 0.30r 0.59g
0.11b - i is the grey value r, g, and b are the red
green and blue values
23HSV Colour model
- HSV is based on colour rather than light
- Hue - what general colour is it
- Saturation how strongly coloured is it
- Value - how bright or dark is it
- Related to how humans perceive color.
- HSV is usually visualised as a cone
- The point of the cone is black
- The top is a colour wheel with white at the
centre and strong colours around the outside
24Uses of the HSI color space
- The intensity description is separated from the
color Can do operations on intensity (e.g.,
histogram equalization) but maintaining the
color. - Similar to our way of describing and classifying
color. - Independent of light conditions/shadows
25HSV colour model
- Value indicates how
- dark or light the colour is
- Hue indicates the angle
- around the colour wheel
- Saturation indicates how
- strong the colour is
26HSV Example
An image, along with its H, S and V components
27RGB to HSV
Let MAX equal the maximum of the (R, G, B)
values, and MIN equal the minimum of those
values.
28RGB to HSV
- We can convert HSV to/from RGB
- Scaling is important, as different values are
used - eg RGB values are often in the range 0,1 or
0,255, hue angles can be in degrees or radians - We will assume RGB values are in the ranges
0,1 - H values in degrees and in the range 0,360
- S and V are in the range 0,1
29RGB to HSV
Note If RGB then we have a grey colour, so H is
undefined
30HSV to RGB
If S 0 then we have a shade of grey so R G
B V
If Hi 0 then R V, Gt , Bp If Hi 1
then R q, GV , Bp If Hi 2 then R p, GV
, Bt If Hi 3 then R p, Gq , BV If Hi
4 then R t, Gp , BV If Hi 5 then R
V, Gp , Bq
31Mixing light and mixing PigmentThe RGB and CMY
color spaces
- Additative mix R G B White, where
- R G Y, etc.
- Subtractive mix C M Y blacK , where C M
B, etc. CMYK is common in printing, where K is
black pigment
32CMYK colour model
- Cyan, Magenta, Yellow, blacK
33CMYK colour model
- Used for printing
- Subtractive colours
- Cyan absorbs red light
- Magenta absorbs green light
- Yellow absorbs blue light
34CMYK colour model
- Mixing them gives RGB
- M Y R
- C Y G
- M Y B
- Theoretically
- C M Y K
- but usually a true black ink is used (because
CMY will not give true black colour so it used
K as real black colour)
35Mapping RGB to CMYK
converting to CMY
and then to CMYK
If
then
else
36Converting CMYK to RGB
tCMY C',M',Y'
tRGB R,G,B
37CMYK Example
CMYK model.
38CMYK Color model
- In principal, equal amounts of cyan (C), magenta
(M), and yellow (Y) should produce black, but to
get a more pure-looking black (and to save
pigment), a fourth color black (K) is often used,
referred to as four-color printing
E.g., a red spot (1, 0, 0) on the screen produces
pigment mix (1, 1, 1) - (1, 0, 0) (0, 1, 1),
meaning equal parts of magenta and yellow.
39YUV model
- The YUV model defines a colour space in terms of
one luminance and two chrominance components - YUV is used in the PAL system
- YUV signals are created from an original RGB
(red, green and blue) source - Y signal, representing the overall brightness, or
luminance, - U and V are colour channels
- U blue-yellow axis
- V red-green axis
40From RGB to YUV
Y uses the same weights as we had for greyscale Y
0.299R 0.587G 0.114B U -0.14713R -0.28886G
0.436B V 0.615R -0.51499G -0.10001B Or, using
a matrix representation
41From YUV to RGB
R Y 1.13983V G Y -0.39466U -0.58060V B Y
2.03211U Or, using a matrix representation
42YUV model
An image along with its Y, U, and V components