ErrorError Diffusion Diffusion Halftoning Halftoning Methods Methods for for HighHigh--QualityQuality PrintedPrinted and and Displayed Displayed ImagesImages
Prof. Brian L. Evans Embedded Signal Processing Laboratory The University of Texas at Austin Austin, TX 78712-1084 USA http:://www.ece.utexas.edu/~bevans
Ph.D. Graduates: Dr. Niranjan Damera-Venkata (HP Labs) Dr. Thomas D. Kite (Audio Precision) Graduate Student: Mr. Vishal Monga Other Collaborators: Prof.AlanC.Bovik(UT Austin) Prof. Wilson S. Geisler (UT Austin) Last modified November 7, 2002 OutlineOutline
• Introduction • Grayscale halftoning methods • Modeling grayscale error diffusion – Compensation for sharpness – Visual quality measures • Compression of error diffused halftones • Color error diffusion halftoning for display – Optimal design – Linear human visual system model • Conclusion
2 Introduction NeedNeed for for Digital Digital Image Image HalftoningHalftoning
• Examples of reduced grayscale/color resolution – Laser and inkjet printers ($9.3B revenue in 2001 in US) – Facsimile machines – Low-cost liquid crystal displays • Halftoning is wordlength reduction for images – Grayscale: 8-bit to 1-bit (binary) – Color displays: 24-bit RGB to 12-bit RGB (e.g. PDA/cell) – Color displays: 24-bit RGB to 8-bit RGB (e.g. cell phones) – Color printers: 24-bit RGB to CMY (each color binarized) • Halftoning tries to reproduce full range of gray/ color while preserving quality & spatial resolution
3 Introduction ConversionConversion to to One One Bit Bit Per Per Pixel: Pixel: Spatial Spatial Domain Domain
Original Image Threshold at Mid-Gray Dispersed Dot Screening
Clustered Dot Floyd Steinberg Stucki Error Screening Error Diffusion Diffusion 4 Introduction ConversionConversion to to One One Bit Bit Per Per Pixel: Pixel: Magnitude Magnitude Spectra Spectra
Original Image Threshold at Mid-Gray Dispersed Dot Screening
Clustered Dot Floyd Steinberg Stucki Error Screening Error Diffusion Diffusion 5 Introduction NeedNeed for for Speed Speed for for Digital Digital Halftoning Halftoning
• Third-generation ultra high-speed printer (CMYK) – 100 pages per minute, 600 lines per inch, 4800 dots/inch/line – Output data rate of 7344 MB/s (HDTV video is ~96 MB/s) • Desktop color printer (CMYK) – 24 pages per minute, 600 lines/inch, 600 dots/inch/line – Output data rate of 220 MB/s (NTSC video is ~24 MB/s) • Parallelism – Screening: pixel-parallel, fast, and easy to implement (2 byte reads, 1 compare, and 1 bit write per binary pixel) – Error diffusion: row-parallel, better results on some media (5bytereads,1compare,4MACs,1byteand1bitwriteper binary pixel) 6 OutlineOutline
• Introduction • Grayscale halftoning methods • Modeling grayscale error diffusion – Compensation for sharpness – Visual quality measures • Compression of error diffused halftones • Color error diffusion halftoning for display – Optimal design – Linear human visual system model • Conclusion
7 Grayscale Halftoning ScreeningScreening (Masking) (Masking) Methods Methods
• Periodic array of thresholds smaller than image – Spatial resampling leads to aliasing (gridding effect) – Clustered dot screening is more resistant to ink spread – Dispersed dot screening has higher spatial resolution – Blue noise masking uses large array of thresholds
Clustered dot mask Dispersed dot mask 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 Thresholds = , , , , , , , , , , , , , , , *256 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32ÿ 8 Grayscale Halftoning GrayscaleGrayscale Error Error Diffusion Diffusion
• Shape quantization noise into high frequencies • Design of error filter key to quality • Not a screening technique
difference threshold current pixel u(m) x(m) b(m) Error Diffusion + _ _ 7/16 + 3/16 5/16 1/16 h(m) e(m) 2-D sigma-delta shape error compute weights error modulation [Anastassiou, 1989] Spectrum 9 Grayscale Halftoning SimpleSimple Noise Noise Shaping Shaping Example Example
• Two-bit output device and four-bit input words – Going from 4 bits down to 2 increases noise by ~ 12 dB – Shaping eliminates noise at DC at expense of increased noise at high frequency. 42 Average output = ¼ (10+10+10+11)=1001 Input To words 22output 4-bit resolution at DC! device Added noise 1sample delay Assume input = 1001 constant 12 dB Time Input Feedback Sum Output (2 bits) 1100100100110 f Periodic 2100101101010 3100110101110 If signal is in this band, 4100111110011 then you are better off 10 Grayscale Halftoning DirectDirect Binary Binary SearchSearch (Iterative) (Iterative)
• Practical upper bound on halftone quality • Minimize mean-squared error between lowpass filtered versions of grayscale and halftone images – Lowpass filter is based on a linear shift-invariant model of human visual system (a.k.a. contrast sensitivity function) • Each iteration visits every pixel [Analoui & Allebach, 1992] – At each pixel, consider toggling pixel or swapping it with each of its 8 nearest neighbors that differ in state from it – Terminate when if no pixels are changed in an iteration • Relatively insensitive to initial halftone provided that it is not error diffused [Lieberman & Allebach, 2000]
11 Grayscale Halftoning ManyMany Possible Possible Contrast Contrast SensitivitySensitivity FunctionsFunctions
• Contrast at particular spatial frequency for visibility – Bandpass: non-dim backgrounds [Manos & Sakrison, 1974; 1978] – Lowpass: high-luminance office settings with low-contrast images [Georgeson & G. Sullivan, 1975] – Modified lowpass version [e.g. J. Sullivan, Ray & Miller, 1990] – Angular dependence: cosine function [Sullivan, Miller & Pios, 1993] – Exponential decay [Näsäsen, 1984] • Näsänen’s is best for direct binary search [Kim & Allebach, 2002] 12 Grayscale Halftoning DigitalDigital HalftoningHalftoning MethodsMethods
Clustered Dot Screening Dispersed Dot Screening Error Diffusion AM Halftoning FM Halftoning FM Halftoning 1976
Blue-noise Mask Green-noise Halftoning Direct Binary Search FM Halftoning 1993 AM-FM Halftoning 1992 FM Halftoning 1992
13 OutlineOutline
• Introduction • Grayscale halftoning methods • Modeling grayscale error diffusion – Compensation for sharpness – Visual quality measures • Compression of error diffused halftones • Color error diffusion halftoning for display – Optimal design – Linear human visual system model • Conclusion
14 Modeling Grayscale Error Diffusion FloydFloyd--SteinbergSteinberg Grayscale Grayscale ErrorError DiffusionDiffusion
Original Halftone
u(m) current pixel x(m) b(m) + _
Floyd- _ 7/16 + Steinberg shape error h(m) 3/16 5/16 1/16 weights e(m) 15 Modeling Grayscale Error Diffusion ModelingModeling Grayscale Grayscale Error Error Diffusion Diffusion • Goal: Model sharpening and noise shaping • Sigma-delta modulation analysis Q(x)
Linear gain model for quantizer in 1-D 255 [Ardalan and Paulos, 1988] 0 x Apply linear gain model in 2-D 0 128 255 [Kite, Evans & Bovik, 1997]
us(m) Ks us(m) Ks u(m) b(m) Signal Path Q(•) n(m)
un(m) un(m)+n(m) • Uses of linear gain model Noise Path Compensation of frequency distortion Visual quality measures 16 Modeling Grayscale Error Diffusion LinearLinear Gain Gain Model Model for for Quantizer Quantizer
• Best linear fit for Ks between quantizer input u(i,j) and halftone b(i,j) Image Floyd Stucki Jarvis = ()α − 2 Ks arg min u(i,j)b(i,j)barbara 2.01 3.62 3.76 α i,j boats 1.98 4.28 4.93 u(i,j) lena 2.09 4.49 5.32 1 1E{}u(i,j) K=i,j = mandrill 2.03 3.38 3.45 s2u2(i,j)2E{}u2(i,j) Average 2.03 3.94 4.37 i,j – Does not vary much for Floyd-Steinberg
– Can use average value to estimate Ks from only error filter
• Sharpening: proportional to Ks Value of Ks: Floyd Steinberg < Stucki < Jarvis
17 Modeling Grayscale Error Diffusion LinearLinear Gain Gain Model Model for for Error Error Diffusion Diffusion
n(m) B()z K Quantizer STF = s = s model + ()()− X(z) 1 Ks 1 Hz x(m) u(m) b(m) K B()z _ s NTF = n =1− H(z) + N(z) f(m) _ + Lowpass H(z) explains h(m) noise shaping e(m) H(ω) STF NTF 2 1 1 ω ω ω −ω −ω −ω 1 ω1 1 ω1 1 ω1
Also, let Ks =2 Pass low frequencies Highpass response (independent of K ) (Floyd-Steinberg) Enhance high frequencies s 18 Modeling Grayscale Error Diffusion CompensationCompensation of of Sharpening Sharpening
• Adjust by threshold modulation [Eschbach & Knox, 1991] – Scale image by gain L and add it to quantizer input –ForL∈(-1,0], higher value of L, lower the compensation – No compensation when L =0 – Low complexity: one multiplication, one addition per pixel
L
u(m) b(m) x(m) + _ _ + h(m) e(m) 19 Modeling Grayscale Error Diffusion CompensationCompensation of of Sharpening Sharpening
• Flatten signal transfer function [Kite, Evans, Bovik, 2000] Globally optimum value of L to compensate for sharpening of signal components in halftone based on linear gain model 1 1− K = − = s ∈ − ≥ L 1 L ( 1,0] since Ks 1 K s Ks
Ks is chosen as linear minimum mean squared error estimator of quantizer output Assumes that input and output of quantizer are jointly wide sense stationary stochastic processes Use linear minimum mean squared error estimator for quantizer to adapt L to allow other types of quantizers [Damera-Venkata and Evans, 2001]
20 Modeling Grayscale Error Diffusion
VisualVisual Quality Quality Measures Measures [Kite, Evans, Bovik, 2000]
• Impact of noise on human visual system Signal-to-noise (SNR) measures appropriate when noise is additive and signal independent
Create unsharpened halftone y[m1,m2] with flat signal transfer function using threshold modulation
Weight signal/noise by contrast sensitivity function C[k1,k2] 2 X[k1,k2]C[k1,k2] WSNR (dB) =10log k1,k2 10 ()−2 X[k1,k2] Y[k1,k2] C[k1,k2] k1,k2 Floyd-Steinberg > Stucki > Jarvis at all viewing distances
21 OutlineOutline
• Introduction • Grayscale halftoning methods • Modeling grayscale error diffusion – Compensation for sharpness – Visual quality measures • Compression of error diffused halftones • Color error diffusion halftoning for display – Optimal design – Linear human visual system model • Conclusion
22 Compression of Error Diffused Halftones JointJoint BiBi--LevelLevel Experts Experts GroupGroup
• JBIG2 standard (Dec. 1999) • Lossy halftone compression – Binary document printing, – Preserve local average gray faxing, scanning, storage level not halftone – Lossy and lossless coding – Periodic descreening – Models for text, halftone, – High compression of and generic regions ordered dither halftones