Notes
Slide Show
Outline
1
Graphics File Format and
Data Compression Techniques
(take 2)  Week 7
2
Business
  • Attendance (please sign in)
3
Tonight
  • Homework 6
  • Lecture
  • Midterm Review
    • If we finish early we leave early
4
No homework this week
  • Please complete all reading
  • Review for the exam
  • Schedule office hours to clear-up any questions
5
Midterm
  • Next week: Monday November 1st
  • We will have the exam followed by lecture
    • 1 hour to complete exam
    • Break
    • Resume at 8 for brief lecture
  • Exam will be closed book
  • No calculator or computer
6
Homework 6
  • What did you think of the HW?
7
Note on Homeworks I have examined
  • Most work
  • Some:
    • Only go RGB -> HSL
    • Don’t display the resulting color
8
C#
  • Surprising number of people requested C#
  • OK, but really need to document code
9
Note on App builders
  • Very nice to quickly build UI
  • However:
    • I don’t intend to hunt for your code between a dozen files full of auto generated code and content
  • Use a framework if you wish but
    • Condense and comment the results
10
Interactive RGB óHSL insights
  • People think of color in terms of
    • Hue, Saturation/Tint, and Luminance/Brightness
  • People rarely consider the relative amounts of Red, Green, and Blue in a color
11
Interactive RGB óHSL insights
  • Variable amounts of any three colors can define the same color
    • Providing the color defined is within all gamuts
12
Engineering insights
  • Easiest to program given an internal representation of color
  • Some feeling of data representation
    • Degrees, percentages, etc. as bits
13
Not the original assignment
  • Wanted you to deal with:
    • Mapping colors between color spaces
    • Some colors are not representable
  • Specifically Mapping
    • Computer’s RGB space into NTSC video
14
Illegal Colors
  • Need Phosphor Chromaticity:
    • NTSC ‘theoretical’
    • Common NTSC TV
    • Common RGB Monitors
15
Brightest is best
  • Brightest TV sells the best


  • Brighter blue phosphor
    • Eye insensitive to blue
      • So only 5% brighter
  • Whopping 9300K white
    • (Compare to 6500K sunlight)
    • At night ever walk past a window with a TV flickering?
16
8 Laws of Color Matching
  • Any color may be matched by mixing at most 3 lights
  • Luminance of a color = sum of the luminance of its components
  • Humans cannot distinguish components of a color match
  • Metameric match is a pair indistinguishable colors with different spectra
17
8 Laws of Color Matching cont.
  • A color match works over a range of luminances
  • If 2 colors match their mixtures will match
  • If 2 colors match and matching colors are subtracted from each the results match
  • If C1 matches C2, and C2 matches C3, then C1 matches C3
18
CIE
  • Commission Internationale de L’Eclairage
  • CIE tristimulus color coords XYZ
19
Color Matching CRT Monitors
  • Theory:
    • Given CIE values of the 3 CRT monitor phosphors
    • And the CIE values for the RGB the monitor uses
    • Original colors can be matched
20
Converting xyY ó XYZ
  • xyY: x,y chromaticity, Y luminance
21
Color Matching CRT Monitors
  • Problem:
    • Monitor specifications are rarely made available by the manufacturer
22
For most monitors
  • xyY=(0.285, 0.293, 1)
  • XYZ=(0.973, 1, 1.440)


  • Corresponds to 9300K white point!
23
CIE and file formats
  • Why isn’t CIE used in most file formats?


  • Positives:
    • Can encode all visible colors
    • Colors are universal
      • Not device specific
24
CIE and file formats
  • Issues:
    • Represents many colors not representable by hardware
    • Larger color space requires more precision
      • (bits to encode at same resolution)
    • Most hardware is non-linear and poorly characterized


  • PNG and proprietary formats encode RGB
    • But provide additional information about the capture device
25
Color matching monitors
  • Matching device specific RGB colors
    • (on, say, 2 video monitors)
  • Accomplished by 1st converting into a common device independent space
    • (CIE space is convenient)
  • Then converting back into the 2nd device’s RGB space using an inverse matrix
26
Color conversion using matrices
  • This is a straightforward matrix operation
    • See Miano p197 for details

  • NOTE:
    • Normalize all values to 0-1 ranges
    • Resultings coordinates <0 or >1 are not representable by the device
      • Called illegal colors
27
Illegal colors
  • Two choices for dealing with illegal colors
    • ‘Limit’ components of illegal colors
      • Changes the color
      • Changes the mix of colors
    • Or compress the color space of the image so all colors ‘fit’
      • This changes the range of colors
      • Preserves the color ‘dynamics’
28
MacAdam Ellipses
  • MacAdam ellipses describe regions of CIE space that humans perceive as indistinguishable
    • (Just noticeable difference)
  • Initially used human subjects on discrimination tests
  • Unsurprisingly human perception of CIE space isn’t uniform
29
MacAdam Ellipses
  • Red ellipses -> measured
  • Blue ellipses -> modeled
    • Based on non-linearities in the cones





  • From: Photoreceptor non-linearities can account for the MacAdam ellipses
30
Uniform Chromaticity
  • Attempts to make color distance = difference
    • CIE Uniform chromaticity Scale (UCS)
    • uvY
    • UVW
    • Lab
31
Gamma
  • Most systems have non-linear response
    • Consider:
      • Film
      • RGB monitors
      • Photoreceptors in our Eyes
  • Gamma represents the response curve
32
Gamma curves
  • Gamma of 1: linear
  • Gamma < 1: low contrast
    • Provides more latitude in dark region
  • Gamma > 1: high contrast
  • CRT monitors: typically 2.0-3.0
33
Gamma in HW/SW
  • Most systems don’t provide HW gamma correction
  • Correspondingly use SW to change the RGB values for pixels in an image
  • Gamma < 1
    • Assigns more values to darker colors
    • (think palate)
34
Gamma curves
  • 0.5 Curve:




  • 2.0 curve:


35
Gamma in HW
  • High end systems
    • Like the SGI systems I build
    • Use an 8 bit gamma palate per RGB channel
      • Fast
      • Non-destructive
36
Gamma issues
  • Gamma more than a function of hardware
  • Gamma also changes based on lighting


  • Gamma can be approximated
  • Using specially prepared image
    • Trading spatial illumination
    • ½ pixels black, ½ pixel max
    • Should equal a region of ½ intensity
37
Gamma
  • Example


38
Gamma Challenges
  • Important to calibrate gamma when creating images
  • Unfortunately PC, Web Content, etc.
    • Authored expecting non-linear gamma
      • Typical PC and Mac gammas differ
        • Content created for 1
          • Looks bad the another
          • Looks bad on properly calibrated display
39
To fix color problem we need
  • Properly characterized
    • Display devices
    • Video output
  • Image formats in device independent color space
  • Display programs that map device independent to device dependent color
  • Hardware acceleration (so there isn’t a ‘penalty’
40
Exam Review: Methodology
  • Don’t expect memorization
    • Other than important constants and concepts
    • Pays to recall if relationships are
      • Linear
      • Geometric
      • Asymptotic
      • Inverse
      • Etc.
41
Exam Review: Questions
  • I don’t like multiple choice/fill in the blank
  • Prefer questions that require thought and demonstrate understanding
  • Expect to:
    • Work mathematical problems
    • Graph
    • Write simple programs
    • Justify a conclusion
42
Topics, Be sure to:
  • Review all lecture notes
    • Will be emphasizing what was covered in class
  • Complete all reading
    • Will expect understanding of this material if not memorization
  • Be able to reproduce any homework
43
Example Topics
  • Data representation
    • Analog vs Digital
      • Sampling
      • Quantization
  • Human Perception
    • Just noticeable difference
    • Sensors
44
Example Topics
  • Information theory
    • Entropy
    • Signal/Noise
  • Entropy Coding
    • Huffman coding
  • Dictionary coding
    • LZ family
45
Example Topics
  • Color
    • Color Perception
      • Tristimulus color
      • Color matching
      • JND
    • Color Representation
      • Color Spaces