Computer Graphics WS07/08 – Color
Computer Graphics
- Color -
Computer Graphics - Color - Hendrik Lensch Computer Graphics - - PowerPoint PPT Presentation
Computer Graphics - Color - Hendrik Lensch Computer Graphics WS07/08 Color Overview Last time The Human Visual System The eye Early vision High-level analysis Color perception Today Gamma Correction
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– The Human Visual System – The eye – Early vision – High-level analysis – Color perception
– Gamma Correction – Color spaces – Transformations
– Tone Mapping
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– amplitude of each frequency
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– Any color can be matched using three linear independent reference colors – May require “negative” contribution to test color – Matching curves describe the value for matching mono- chromatic spectral colors of equal intensity
set of primary colors
Computer Graphics WS07/08 – Color
– Color matching experiments – Group ~12 people with „normal“ color vision (from London area) – 2 degree visual field (fovea only) – Other Experiment in 1964
– Transformation to a set of virtual primaries
– Goals
Computer Graphics WS07/08 – Color
– Imaginary primaries more saturated than monochromatic lights
– Y is roughly equivalent to luminance
– Monochromatic spectral colors form a curve in 3D XYZ-space – Matching curves for virtual CIE XYZ primaries
m m m
virtual red virtual green virtual blue
Computer Graphics WS07/08 – Color
– Concentrate on color, not light intensity – Relative color coordinates – etc Projection on the plane
– z= 1-x-y – Chromaticity diagram: 2D-Plot over x and y – Points in diagram are called „color locations“ – White point: ~(0.3, 0.3)
Z Y X X x + + =
The CIE xy chromaticity diagram
Computer Graphics WS07/08 – Color
1931 CIE-xy CIE-uv (1960) CIE-u`v` (1976)
Computer Graphics WS07/08 – Color
– Saturation: relative distance to the white point – Complementary colors: on other side of white point
Computer Graphics WS07/08 – Color
– Device-independent
– Triangle inside color space with additive color blending
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– Complex for printer, because
– Complex interactions between printed color points – Depends on printer colors and printer technique
– Each device should replace its out-
nearest approximate achievable colors – Possible significant color distortions in a printed scanned displayed image
Computer Graphics WS07/08 – Color
– Perfect emitter of energy, the whole energy emitted due to thermal excitation only – Has a fixed frequency spectrum ρ= ρ(λ, T) (Planck’s law) – Spectrum can be converted into color location
black body increases
– Allows for white point specification through temperatures
Computer Graphics WS07/08 – Color
– Illuminant A – incandescent lighting conditions with a color temperature of about 2856°K – Illuminant B – direct sunlight at about 4874°K – Illuminant C – indirect sunlight at about 6774°K – Illuminants D50 and D65 – different daylight conditions at color temperatures 5000°K and 6500°K, respectively
Computer Graphics WS07/08 – Color
– Represented as a matrix
– Measure the spectral distribution (samples every 5-10 nm) – Projecting from mD to 3D using matching curves (loss of information)
[ ] [ ] [ ]
1 x m ... m x 3 ,.., , , ,.., , , ,.., , , ) ( ) ( ) ( ) ( 1 x 3
2 1 3 2 1 3 2 1 3 2 1
⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡
m m m m e
l l l z z z z y y y y x x x x L z y x Z Y X λ λ λ λ PL
⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ B G R Z Z Z Y Y Y X X X B G R Z Y X
B G R B G R B G R
M
Computer Graphics WS07/08 – Color
– Given primary colors (xr, yr), (xg, yg), (xb, yb) and white point (xw, yw)
– Set Cr= Xr+Yr+Zr – xr=Xr/(Xr+Yr+Zr)= Xr/Cr Xr=xrCr (analogous for xg, xb) – Given that R,G,B are factors modulating the primaries
– Inserting yields
⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − − = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ B G R C y x C y x C y x C y C y C y C x C x C x Z Y X
b b b g g g r r r b b g g r r b b g g r r
) 1 ( ) 1 ( ) 1 (
Computer Graphics WS07/08 – Color
– Per definition the white point is given as
– (Xw, Yw, Zw) can be computed using the normalization constant
b b b g g g r r r b b g g r r b b g g r r w w w
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– Simplest model for computer graphics – Natural for additive devices (e.g. monitors) – Device dependent !!!! – Definition of standard-RGB (sRGB)
Computer Graphics WS07/08 – Color
– Specification of default CIE-XYZ values for monitors
0.6400, 0.3300
0.3000, 0.6000
0.1500, 0.0600
0.3127, 0.3290 (D65)
2.2
– Same values as HDTV and digital video (ITU-R 709) – http://www.color.org
– sRGB is a standard-replacement profile of ICC – All image data’s without ICC profile implicit lie in sRGB – Generating: ICC-Profile or writing sRGB – Reading: using ICC-Profile or assume sRGB – Output: using ICC-Profile or assume sRGB
Computer Graphics WS07/08 – Color
– Motivated from artistic use and intuition – H is equivalent to tone – S is equivalent to saturation (H undefined for S == 0) – V/B is equivalent to the gray value – Pure tones for S == 1 and V == 1 – Intuitive model for color blending – Builds on RGB
Computer Graphics WS07/08 – Color
– Similar to HSV/HSB – Slightly less intuitive
– TekHVC
– Video-processing
– Non-linear color spaces
Computer Graphics WS07/08 – Color
– RGB: 0.5 red + 0.5 green = dark yellow 0.5*(1,0,0)+0.5*(0,1,0)= (0.5,0.5,0) – HSV: 0.5 red + 0.5 green = pure yellow 0.5*(0º,1,1)+0.5*(120º,1,1)= (60º,1,1) – Interpolation in RGB
– Interpolation in HSV
„yellow lies between red and green“
Computer Graphics WS07/08 – Color
– Same differences of xy lead to very different perceived differences (purples tightly packed, greens stretched out) – Transforming in uniform color space (similarly to gamma) – Measure color difference there
CIE-XYZ L´u*v*
purples greens
Computer Graphics WS07/08 – Color
– Converting to XYZ (Y incidental luminance) – Non-linear transformation on Y (Yn is Y of the white point) – Transformation of color differences { }
100 ,..., * ) / ( 3 . 903 : 008856 . / 16 ) / ( 116 : 008856 . / *
3 / 1
∈ ⎩ ⎨ ⎧ < − ≥ = L Y Y Y Y Y Y Y Y L
n n n n
) ´ ´ ( * 13 * ) ´ ´ ( * 13 * ) 3 15 /( 9 ´ ) 3 15 /( 4 ´
n n
v v L v u u L u Z Y X Y v Z Y X X u − = − = + + = + + = ⎩ ⎨ ⎧ + < ≥ = − = − = 116 / 16 787 . 7 008856 . 008856 . ) ( )] / ( ) / ( [ * 500 * )] / ( ) / ( [ * 500 *
3 / 1
x x x x x f Z Z f Y Y f L b Y Y f X X f L a
n n n n
(limited applicability to HDR)
Computer Graphics WS07/08 – Color
+ + x x = = x x
Additive blending Subtractive blending With additive primary colors Does not work !!! Subtractive blending
cyan (C) mangenta (M)
=
Computer Graphics WS07/08 – Color
– Subtractive color blending – In theory:
– In practice: profoundly non-linear transformation
Computer Graphics WS07/08 – Color
– What to do if colors lay
– Clamp, Scale
– Product of all primary colors must be black – Any number of colors (CMY, CMYK, 6-color-print, etc.) – It does not need to obtain (CMY)= 1-(RGB)
Computer Graphics WS07/08 – Color
– Intensity I of electron beam is non-linear with respect to the applied voltage U – Best described as power law
Gamma-Factor γ = ~2.2 due to physical reasons
– Pre-correct output values to achieve overall linear curve – Quantization loss if value represented with less than 12 Bit
Computer Graphics WS07/08 – Color
– Correctly: you would need a colorimeter, spectrophotometer – The procedure:
– Change „Brightness“ so that (0,0,0) just has no light emission – Change „Contrast“ so that (1,1,1) is bright as possible – without blurring – Iterate
0.5 - grey
Computer Graphics WS07/08 – Color
Computer Graphics WS07/08 – Color
– Strong color corruptions
Shifts in reproduced chromaticities resulting from uncompensated gamma of 1.273 (such a gamma is desirable to compensate the contrast lowering in the dim surround).
Computer Graphics WS07/08 – Color
– Old cameras (electron tube) also had a Gamma factor – Essentially the inverse of the monitor gamma (due to Physics)
– Human brightness perception roughly follow the gamma curve
– Optimal coding for transmitted values
Computer Graphics WS07/08 – Color
Input (camera) Output (Monitor) Video & film: More less linear w.r.t. perception γ = 1/1.96 γ = 2.2 γ = ~1/3 Computer graphics linear in physical units (radiance) γ = 1/2.2 Gamma- correction Gamma- correction γ = 1.96 Video-input, scans, textures Gamma LUT SGI: 1/1.7 Apple: 1/1.4
Computer Graphics WS07/08 – Color
– Color coordinate system often unknown
– Multiple transformations
– Gamma-correction depends on application
– Video-/image editing
– Image syntheses, interpolation, color blending, rendering, ...
Computer Graphics WS07/08 – Color
– Standardized specification of color spaces – Profile Connection Space (PCS) – intermediate, device-independent color space (CIELAB and CIEXYZ supported) – ColorDevice #1 PCS ColorDevice #2
– A file with data describing the color characteristics of a device (such as a scanner, printer, monitor) or an image – Simple matrices – Transformation formulas (if necessary proprietary) – Conversion tables
– Using profiles for color transformations – Optimizes profile-sequences transformations – No standard-API
– Inaccurate specifications – Interoperability – Difficult to generate profiles
Computer Graphics WS07/08 – Color
input device input device (e.g. camera) (e.g. camera) input profile input profile profile profile connection connection space space
(e.g. printer) (e.g. printer)
display display device device (e.g. (e.g. monitor) monitor) monitor monitor profile profile
Computer Graphics WS07/08 – Color
– profile connection spaces
– can be used to create an high dynamic range image in the profile connection space – allows for a color calibrated workflow
input device input device (e.g. camera) (e.g. camera) input profile input profile profile profile connection connection space space
(e.g. printer) (e.g. printer)