space-filling curve ordered dither
TRANSCRIPT
Algorithms Corner
SPACE-FILLING CURVE ORDERED DITHER
YUEFENG ZHANG
Motorola Building IL-27, MS 2d7, 1501 West Shure Drive, Arlington Heights, IL 60004, USA
AbstractÐThis paper presents a new ordered dithering algorithm that improves the conventionalordered dither in image quality by using space-®lling curves. In this method, dither thresholds areassigned to the pixels of an image by replicating a one-dimensional dither array over a space-®llingcurve that ®lls up the image. This method can be more ¯exible than other halftoning techniques in thatit can generate both clustered and dispersed patterns of dots. Experimental results demonstrate that thenew method can greatly improve ordered dither in image quality by generating clustered patterns ofdots and simulate ordered dither by producing dispersed dot patterns. # 1998 Elsevier Science Ltd. Allrights reserved
Key words: space-®lling curve, ordered dither, halftoning.
1. INTRODUCTION
Digital halftoning is a process of transforming a
gray scale image into a binary image. Such a processis necessary to print (display) a gray image on abinary device such as a laser printer (CRT monitor).
There are two widely used halftoning techniques:ordered dither [1, 2] and error di�usion [3, 4].
Ordered dither is fast and highly parallelizable.The major drawback is that it tends to blur images.
Recently some approaches [5, 6] have been pro-posed that improve ordered dither in image quality.This paper presents a new algorithm, called space-
®lling curve ordered dither (SFCOD) (see Section 2for details), that can signi®cantly improve ordered
dither in image quality by determining ditherthresholds along a space-®lling curve.
The motivation of this new method is space di�u-sion [7], a new error di�usion algorithm recentlyproposed by Zhang and Webber.
Most error di�usion algorithms [3, 4, 7, 8] pro-duce images with dispersed dot patterns, that is, pat-
terns in which black and white pixels are evenlydistributed. These algorithms are only suitable for
devices (e.g., CRT monitors) that can control indi-vidual pixels. On a device, such as a laser printer,that cannot generate isolated dots (pixels) appropri-
ately, the above algorithms can produce poorimages. This di�culty is avoided in the approaches
proposed by Velho and Gomes [9, 10] by generatingclustered dot patterns along a space-®lling curve,that is, patterns in which black and white pixels are
concentrated together forming clusters [9, 10]. Likeother error di�usion techniques [3, 4, 7, 8], these
methods are very expensive. This disadvantage isavoided in SFCOD by using a space-®lling curvebased dither array.
The method SFCOD below inherits the advan-tages of both ordered dither [1, 2] and space di�u-
sion [7] and at the same time, avoids their
shortcomings. In particular, like ordered dither,SFCOD is a dither array based technique and thus,is very e�cient. Like space di�usion, in SFCOD,the source image is subdivided into small regions
along a space-®lling curve and thus, artifacts suchas regular patterns of dots, which usually occur inordered dither, are removed.
The rest of this paper is arranged as follows. InSection 2, the method SFCOD is presented. ThenSection 3 presents experimental results. Finally,
Section 4 presents the conclusion.
2. SPACE-FILLING CURVE ORDERED DITHER (SFCOD)
2.1. Ordered dither
Let I be a n�n gray image, H the correspondinghalftoned binary image, and A a m�m ditherthreshold array, where m< n. Then the process ofordered dither [1, 2] can be divided into the follow-
ing two stages:
. Using the dither array A to divide the pixels ofthe image I into m2 classes: the class number of
pixel (i,j), 0R i,jRnÿ 1, is A(i mod m, j mod m).. Using the resulting class numbers to halftone Iinto H: the pixel H(i,j) of the binary image H is
set to 1 (on) if I(i,j)r (A(i mod m, j modm) + 0.5)/m2, otherwise H(i,j) is set to 0.
2.2. Space di�usionIn space di�usion [7], the pixels of the gray image
are divided into classes by using a space-®lling
curve over the image before the process of halfton-ing has begun.As an example of using a space-®lling curve to
class pixels, Fig. 1 shows the process of using a
Comput. & Graphics, Vol. 22, No. 4, pp. 559±563, 1998# 1998 Elsevier Science Ltd. All rights reserved
Printed in Great Britain0097-8493/98 $19.00+0.00
PII: S0097-8493(98)00043-0
559
Hilbert curve [9] to divide the pixels of a 8�8
image into 16 classes. Figure 1a shows a discrete
Hilbert curve over the image. A traversal ordering
of the image determined by the Hilbert curve is
shown in Fig. 1b. The pixels of the image can be
subdivided into 16 classes by replicating the one-
dimensional array of 0, 1, 2, . . . , 15 over the Hilbert
curve (see Fig. 1c).
In space di�usion, after the pixels of the image Ihave been divided into classes, the image I is half-
toned into the binary image H by using a ®xeddither threshold value (0.5) as follows: H(i,j) =1 ifI(i,j)r0.5; Otherwise, H(i,j) = 0.
2.3. SFCODIn both ordered dither [1, 2] and space di�usion
[7], the pixels of the image are divided into classes.
Two of the main di�erences between them exist inthe following two aspects:
. Dividing the pixels of the image into classes: in
ordered dither, class numbers are obtained froma two-dimensional dither array. In space di�u-sion, however, class numbers are generated byusing a one-dimensional array of traversing order
numbers along a space-®lling curve.. Using the class numbers to halftone the image: inordered dither, the pixel class numbers are used
as dither thresholds in the process of halftoning.In space di�usion [7], however, the class numbersof pixels are only used to control the process of
halftoning as dot di�usion [4] does. The advan-tage of doing so is that it can generate pleasingimages if a strategy of di�using errors [4, 7] is
combined. The disadvantage is that it is muchmore expensive compared with ordered dither [1,2].
I observe that the advantages of ordered ditherand space di�usion can be combined by using thepixel class numbers in space di�usion [7] as thedither thresholds in ordered dither [1, 2]. In other
words, we divide the pixels of the image into classesin the same way as used in space di�usion. But,rather than using the resulting class numbers to
control the process of halftoning as space di�usion[7] does, like ordered dither [1, 2] we use them asdither thresholds.
In space-di�usion, the pixels of the image aredivided into k classes by replicating the one-dimen-sional array of 0, 1, 2, . . . , kÿ 1 over a space-®llingcurve. In general we can divide the pixels of the
image into k classes by replicating a permutation Aof 0, 1, 2, . . . , kÿ 1 over the space-®lling curve.Such a permutation A is used as a one-dimensional
dither array, called space-®lling curve dither array,in this paper (see the following algorithm fordetails). The resulting ordered dither is called space-
®lling curve ordered dither (SFCOD).Given an n�n image I, let C(n,n) be the map of
a traversing order numbers of the pixels of the
image I along a space-®lling curve over I and, A(k)a space-®lling curve dither array (i.e., a permutationof 0, 1, 2, . . . , kÿ 1), where k is the length of thedither array. Then the method SFCOD can be for-
mulated as the following algorithm:
PROCEDURE SFCOD(C, A, k, I, H)BEGIN
Fig. 1. Subdividing a 8� 8 image into 4�4 regions byusing a Hilbert polygon
Y. Zhang560
FOR i =0 TO nÿ 1 DO FOR j =0 TO
nÿ 1 DO
IF I(i,j)r (A(C(i, j) MOD k) + 0.5)/k
THEN H(i,j) = 1 ELSE H(i,j) = 0;
END
The patterns of dots generated by the above
SFCOD algorithm will depend on the de®nition of
the space-®lling curve dither array A.
If we de®ne the space-®lling curve dither array A
as follows: A(i) = i, i = 0, 1, 2, . . . , kÿ 1, then, like
the space-®lling curve based methods [9, 10], the
resulting SFCOD can generate ¯exible clustered
patterns of dots. This is equivalent to the case
where the class number array in space di�usion [7]
is used as a dither array in SFCOD. For conven-
ience, in the following, such a SFCOD is called
clustered SFCOD. The size of a clustered dot pat-
tern produced by a clustered SFCOD is pro-
portional to the length k of the corresponding
space-®lling curve dither array.
If we determine the space-®lling curve dither
array A by traversing a dispersed ordered dither
array [1, 2] (see Fig. 2), then the resulting SFCOD
will generate dispersed patterns of dots. Such a
SFCOD is called dispersed SFCOD in the followingdiscussion.
Figure 2a shows a 4�4 dispersed dither array [1,2]. By traversing this dither array according to thepixel ordering of the top-left 4� 4 region in Fig. 1c,
we have the following space-®lling curve ditherarray: 15, 7, 11, 3, 12, 0, 8, 4, 14, 2, 10, 6, 9, 1, 13,5.
Figure 2b shows the dither thresholds of the pix-els of a 8�8 image that are obtained by replicatingthe above space-®lling curve dither array over theHilbert curve shown in Fig. 1a.
3. EXPERIMENTAL RESULTS
In this section, an image of a boat scene is usedto evaluate the performance of the SFCOD algor-
Fig. 2. (a) A 4� 4 dispersed dither array with a Hilbertcurve; (b) A 8�8 map of dither thresholds determined byreplicating the space-®lling curve dither array 15, 7, 11, 3,12, 8, 4, 14, 2, 10, 6, 9, 1, 13, 5 over the Hilbert curve in
Fig. 1a
Fig. 3. The image of the boat scene halftoned by theordered dither
Fig. 4. The image of the boat scene halftoned by the dis-persed space-®lling curve ordered dither
Space-®lling curve ordered dither 561
ithm presented in this paper. The reason of choos-
ing this image is that it contains lots of image
details. Such an image is usually good at evaluating
a halftoning method.
Figure 3 shows the result of halftoning a
256�256 image of the boat scene by ordered dither
[1, 2]. The result of using a dispersed SFCOD with
the dither array 15, 7, 11, 3, 12, 0, 8, 4, 14, 2, 10, 6,
9, 1, 13, 5 (see Fig. 2a) is shown in Fig. 4. By com-
paring Figs 3 and 4, we can observe that the dis-
persed SFCOD produces images that are similar to
the images generated by the traditional ordered
dither. From this point of view, the traditional
ordered dither [1, 2] can be considered as a special
case of SFCOD.
The halftoned image in Fig. 5 is obtained byusing a clustered SFCOD. The size of the space-®ll-
ing curve dither array used equals 4. It can be seenby comparing Fig. 5 with Fig. 3 that the clusteredSFCOD improves the traditional ordered dither [1,
2] signi®cantly in image quality.Figure 6 is used to demonstrate the behavior of
changing the size of the space-®lling curve dither
array. The halftoned image in Fig. 6 is produced bya clustered SFCOD with a dither array of size 8. Bycomparing Fig. 6 with Fig. 5, we can observe that
using larger space-®lling curve dither array gener-ates more obvious clustered patterns of dots in aclustered SFCOD.In summary, experimental results show that the
clustered SFCOD is much better than the conven-tional ordered dither in image quality, but the dis-persed SFCOD and the conventional ordered dither
produce similar images.
4. CONCLUSION
In this paper, a space-®lling curve ordered dither(SFCOD) was presented. In this method, dither
thresholds are assigned to the pixels of the imageunder halftoning by replicating a one-dimensionaldither array along a space-®lling curve over the
image. In this manner both clustered and dispersedpatterns of dots can be generated by using dispersedSFCOD and clustered SFCOD, respectively.
Experimental results show that a clustered SFCODcan greatly improve the traditional ordered ditherin image quality.
The clustered SFCOD algorithm inherits the ad-vantages of both ordered dither [1, 2] and space dif-fusion [7]. Like ordered dither [1, 2], in theclustered SFCOD, the pixels of an image are half-
toned by comparing their intensities with ditherthresholds and all these pixels can be processed inparallel. Thus, the clustered SFCOD is fast and
completely parallelizable. Like space di�usion [7], inthe clustered SFCOD, the image is subdivided intosmall regions along a space-®lling curve over the
image and thus, artifacts such as regular dot pat-terns are removed.Most halftoning methods proposed in the litera-
ture [1±3, 5±8] can only produce dispersed patterns
of dots. Because of this, these methods can fail toproduce good images on a device (e.g., laser printer)that cannot precisely control isolated dots. Some
halftoning approaches [9, 10] have been proposedfor solving this problem. Unfortunately, thesemethods are quite expensive. The above di�culties
are removed in the clustered SFCOD by combiningthe advantages of both ordered dither and space-®lling curve based error di�usion methods.
I observe that, if a strategy of adaptive clustering[10] is combined with the clustered SFCOD, a newhalftoning technique results that can furtherimprove the clustered SFCOD in revealing image
Fig. 5. The image of the boat scene halftoned by a clus-tered space-®lling curve ordered dither with a clustered
space-®lling curve dither array of size 4
Fig. 6. The image of the boat scene halftoned by a clus-tered space-®lling curve ordered dither with a clustered
space-®lling curve dither array of size 8
Y. Zhang562
details. This improvement is presented elsewhere[11] due to the limit of space.
REFERENCES
1. Jarvis, J. F., Judice, C. N. and Ninke, W. H., A sur-vey of techniques for the display of continuous tonepictures on bilevel displays. Computer Graphics andImage Processing, 1976, 5, 13±17.
2. Judice, C. N., Jarvis, J. F. and Ninke, W. H., Usingordered dither to display continuous tone pictures onan AC Plasma Panel. Proceedings of the S.I.D., 1974,15(4), 161±169.
3. Floyd, R. W. and Steinberg, L., An adaptive algor-ithm for spatial greyscale. Proceedings of the S.I.D.,1976, 17(2), 75±77.
4. Knuth, D. E., Digital halftones by dot di�usion.ACM Transactions on Graphics, 1987, 6(4), 245±273.
5. Ostromoukhov, V., Hersch, R. D. and Amidror, I.,Rotated dispersed dither: a new technique for digitalhalftoning. Proceedings of SIGGRAPH `94, ACMComputer Graphics, Annual Conference Series, 1994,pp. 123±130.
6. Ulichney, R., The void-and-cluster method for ditherarray generation, In I'S&T/SPIE Symposium onElectronic Imaging Science and Technology,Proceedings Conf. Human Vision, Visual Processingand Digital Display IV, (Eds Allebach, Rogowitz),SPIE Vol. 1913, 1993, pp. 332±343.
7. Zhang, Y. and Webber, R. E., Space di�usion: animproved parallel halftoning technique using space-®lling curves. In Proceedings of SIGGRAPH' 93,ACM Computer Graphics, Annual Conference Series,1993, pp. 305±312.
8. Zhang, Y., Line di�usion: a parallel error di�usion al-gorithm for digital halftoning. The Visual Computer,1995, 11(1-15), 40±44.
9. Velho, L. and Gomes, J. de M., Digital halftoningwith space ®lling curves. Computer Graphics, 1991,25(4), 81±90.
10. Velho, L. and Gomes, J., Stochastic screening dither-ing with adaptive clustering. In Proceedings ofSIGGRAPH' 95, ACM Computer Graphics, AnnualConference Series, 1995, pp. 273±276.
11. Zhang, Y., Adaptive ordered dither. Graphical Modelsand Image Processing, 1997, 59(1), 49±53.
Space-®lling curve ordered dither 563