CSCE 441 Lecture 15

From Notes
Jump to navigation Jump to search

« previous | Monday, February 17, 2014 | next »


Halftoning and Dithering

Eyes integrate over an area: all light hitting a receptor cell is combined and averaged.

Thus we can simulate varying intensity by filling in fractions of areas.

Convert Grayscale Image to Black and White

Naïve way is to use threshold: if pixel value is darker than "50%", make the entire pixel black. Otherwise, make the entire pixel white.

Original Threshold


Halftoning

  • subdivide image into blocks of pixels
    • you will lose resolution
  • number of intensity levels is related to the number of pixels in a block:
    • 2 × 2 → 5 intensity levels
    • 3 × 3 → 10 intensity levels

Patterns

Pattetrns make a difference because the brain is really good at identifying.

We want a "random" pattern so that artificial artifacts don't appear.

Each successive block pattern should be a superset of the previous.

2×2 Example

0.0 – 0.2
0.2 – 0.4
0.4 – 0.6
0.6 – 0.8
0.8 – 1.0
Original Halftoning 2x2


3×3 Example

Original Halftoning 3x3


3×3 Example (Bad Pattern)

Original Halftoning 3x3 Bad

Dithering

  • Keeps same resolution
  • change halftoning pattern into a probability/threshold function (dither pattern)
  • overlay dither pattern on entire image
  • Fill a pixel if and only if it is higher density than dither value.


Example

0.2 0.6
0.8 0.4
Original Dithering

Error Diffusion

Another way to set levels without changing resolution.

Assume pixels are being visited in some order (Left/Right, Top/Bottom) Roundoff errors (from filling or not filling a pixel) get diffused to adjacent pixels not visited yet.

Example

visited

whoa!

Original Error Diffusion

Color

Very much related to perception, but there is a physical definition

Light

EM spectrum

Visible Light

We see a very narrow band: about 300 nm to 700 nm wavelengths.

different types of cones respond to certain wavelengths

  • We have 3 different cones (usually correspond to red, green, and blue)
  • color space is 3-dimensional

CIE XYZ system

compute convolution of weighting function and color matching functions , , and .

Graph of visible light is subset of the 3D space this is plotted in.

  • White is at center of diagram (point of equal energy)
  • Colors are at very edge
  • Hue is angle from white to edge
  • Saturation is distance from white to edge
  • Non-spectral colors do not correspond to any wavelength of light and appear in the triangle formed between white and the lower 2 angles.

Picking any 3 points produces a range of producable colors called the gamut

Monitors generally cover most of the visible spectrum with red, green, and blue; but some color is always lost.

Can never reproduce entire spectrum from 3 colors since the axes of the spectrum themselves are not visible.