quantization if too few levels of gray, (e.g. decrease halftone spot size to increase spatial...

24
Quantization • If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels become apparent. This can happen in color halftoning also. • See demo at http://www.ctr.columbia.edu/~sfcha ng/course/dip/demos/Quat.html

Post on 21-Dec-2015

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Quantization

• If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels become apparent. This can happen in color halftoning also.

• See demo at http://www.ctr.columbia.edu/~sfchang/course/dip/demos/Quat.html

Page 2: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Saturation

• Distance from white point

• Adding white desaturates but does not change hue or perceptual brightness.

• HSB model is approximate representative of this. See PhotoShop

Page 3: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Device Independence

• Calibration to standard space– typically CIE XYZ

• Coordinate transforms through standard space

• Gamut mapping

Page 4: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Device independence

• Stone et. al. “Color Gamut Mapping and the Printing of Digital Color Images”, ACM Transactions on Graphics, 7(4) October 1998, pp. 249-292.

• The following slides refer to their techniques.

Page 5: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Device to XYZ

• Sample gamut in device space on 8x8x8 mesh (7x7x7 = 343 cubes).

• Measure (or model) device on mesh.

• Interpolate with trilinear interpolation – for small mesh and reasonable function

XYZ=f(device1, device2, device3) this approximates interpolating to tangent.

Page 6: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

XYZ to Device

• Invert function XYZ=f(device1, device2, device3)

– hard to do in general if f is ill behaved– At least make f monotonic by throwing out

distinct points with same XYZ.

• e.g. CMY device:– (continued)

Page 7: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

XYZ to CMY

• Invert function XYZ=f(c,m,y)– Given XYZ=[x,y,z] want to find CMY=[c,m,y]

such that f(CMY)=XYZ– Consider X(c,m,y), Y(c,m,y), Z(c,m,y)– A continuous function on a closed region has

max and min on the region boundaries, here the cube vertices. Also, if a continuous function has opposite signs on two boundary points, it is zero somewhere in between.

Page 8: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

XYZ to CMY

– Given X0, find [c,m,y] such that f(c,m,y) = X0

– if [ci,mi,yi] [cj,mj,yj] are vertices on a given cube, and U=X(c,m,y)- X0 has opposite sign on them, then it is zero in the cube. Similarly Y, Z. If find such vertices for all of X0,Y0,Z0, then the found cube contains the desired point. (and use interpolation). Doing this recursively will find the desired point if there is one.

Page 9: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Gamut Mapping

• Criteria:– preserve gray axis of original image– maximum luminance contrast– few colors map outside destination gamut– hue, saturation shifts minimized– increase, rather than decrease saturation– do not violate color knowledge, e.g. sky is blue,

fruit colors, skin colors

Page 10: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Gamut Mapping

• Special colors and problems– Highlights: this is a luminance issue so is about

the gray axis– Colors near black: locus of these colors in

image gamut must map into something reasonably similar shape else contrast and saturation is wrong

Page 11: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Gamut Mapping

• Special colors and problems– Highly saturated colors (far from white point):

printers often incapable.– Colors on the image gamut boundary

occupying large parts of the image. Should map inside target gamut else have to project them all on target boundary.

Page 12: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

CRT

Printer

Gamuts

Page 13: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Gamut Mapping

• First try: map black points and fill destination gamut.

Page 14: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

device gamutimage gamut

Page 15: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

translate Bito Bddevice gamut

image gamut

bs (black shift)

Page 16: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

translate Bito Bd

scale by csf

device gamutimage gamut

Page 17: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

translate Bito Bd

scale by csf rotate

device gamutimage gamut

Page 18: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Gamut Mapping

Xd = Bd + csf R (Xi - Bi)

Bi = image black, Bd = destination black

R = rotation matrix

csf = contrast scaling factor

Xi = image color, Xd = destination color

Problems:Image colors near black outside of destination are

especially bad: loss of detail, hue shifts due to quantization error, ...

Page 19: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

shift and scale alongdestination gray

Xd = Bd + csf R (Xi - Bi) + bs (Wd - Bd)

Page 20: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Fig 14a, bs>0, csf small, image gamut maps entirelyinto printer gamut, but contrast is low.

Fig 14b, bs=0, csf large, more contrast, more colors inside printer gamut, butalso more outside.

Page 21: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Saturation control

• “Umbrella transformation”[Rs Gs Bs] = monitor whitepoint

[Rn Gn Bn] new RGB coordinates such that Rs + Gs + Bs = Rn + Gn + Bn

and [Rn Gn Bn] maps inside destination gamut

First map R Rs+G Gs+B Bs to R Rn+G Gn+B Bn Then map into printer coordinatesMakes minor hue changes, but “relative” colors

preserved. Achromatic remain achromatic.

Page 22: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Projective Clipping

• After all, some colors remain outside printer gamut

• Project these onto the gamut surface:– Try a perpendicular projection to nearest

triangular face in printer gamut surface.– If none, find a perpendicular projection to the

nearest edge on the surface– If none, use closest vertex

Page 23: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Projective Clipping

• This is the closest point on the surface to the given color

• Result is continuous projection if gamut is convex, but not else.– Bad: want nearby image colors to be nearby in

destination gamut.

Page 24: Quantization If too few levels of gray, (e.g. decrease halftone spot size to increase spatial resolution), then boundaries between adjacent gray levels

Projective Clipping

• Problems– Printer gamuts have worst concavities near

black point, giving quantization errors.– Nearest point projection uses Euclidean

distance in XYZ space, but that is not perceptually uniform.

• Try CIELAB? SCIELAB? • Keep out of gamut distances small at cost of use of

less than full printer gamut use.