COMPUTER VISION, GRAPHICS,AND IMAGEPROCESSING24, 107-113 (1983)
NOTE
Image Enhancement in a Dithered Picture AKIRA SHIOZAKI
Faculty of Engineering, Osaka Electro-Communication University, 18-8 Hatsucho Neyagawa, Osaka 572, Japan Received April 19, 1982; revised July 6, 1982; accepted August 30, 1982
A technique called ordered dither for displaying continuous tone pictures on a bilevel display or a display with limited levels has been investigated. In a dithered picture with many pseudo halftones, edges are blurred and letters or drawings are indistinct. A technique for edge enhancement to display dithered pictures of high quality is presented. The method partially controls the contrast of the dithered picture. The displayed picture can be easily enhanced by changing the thresholds of the dither matrices. The method has the advantages of simple processing, simple hardware construction, and high quality picture display. It is a very powerful and flexible image processing method. I. INTRODUCTION
A number of techniques for displaying continuous tone pictures on a bilevel display or a display with limited levels have been investigated [1-6]. Ordered dither, which is one of the techniques, has the advantage of simple processing and simple hardware construction [ 1, 2]. In the ordered dither technique, a dither matrix, which is a matrix of thresholds of large size, gives a lot of pseudo halftones, but reduces spatial resolution. That is, the edges of a dithered picture are somewhat indistinct. Especially, when a gray tone image contains letters or drawings, they are blurred in the dithered picture. This paper presents a technique for edge enhancement by changing the thresholds of the dither matrices. It enhances edges by partially controlling the contrast of the dithered picture. 2. ORDERED DITHER
A display with m levels can represent ( m - 1)n2+ 1 pseudo halftones using (m - 1) n × n dither matrices, each of which is a matrix of thresholds. Each pixel in an input image is compared with the corresponding element of each dither matrix and the level of the corresponding display cell is determined according to this comparison. Let the number of brightness levels of the display cells be m (level 0 is black and level m - 1 is white). (m - 1) dither matrices D~ (k = 1, 2 . . . . . m - 1) of size n (n is a power of 2) can be determined as follows:
I
4D~/2
P 4D~/2 + 2U n/2 "
_
I
OF = [ 4D~/2
_ _
+
(n
3un/2 'll 4D7/2 +
D~=D~_ 1 +n2U"
(k=2,3
un/2
.... ,m-
> 4) =
(1)
1)
107 0734-189X/83 $3.00 Copyright© 1983by AcademicPress, Inc. All rightsof reproductionin any form reserved.
108
AKIRA SHIOZAKI
where U" denotes an n X n matrix whose elements are all 1. The elements of D~ (k = 1, 2 . . . . . m - 1) contain every integer from 0 to (m - 1)n 2 - 1 exactly once. Let the brightness of each pixel in the input image be quantized to L discrete levels. The elements of the dither matrices D~ (1 < k < m - 1) in Eq. (1) are multiplied by L / ( m - 1)n 2 so that the number of threshold levels of the dither matrices may be normalized to the number of quantization levels. The matrices, each element of which is the maximum integer not greater than the corresponding element of the resulting normalized dither matrices, are the ones actually used in ordered dither processing. Let the normalized dither matrices be denoted by D~-~(1 < k < m - 1). (m - 1) dither matrices D~-~(k = 1, 2 . . . . . m - 1) are repeated in a doubly periodic, checkerboard fashion such that each pixel in the input image has m - 1 corresponding thresholds. Let B(i,j ) be the brightness level of the (i, j ) pixel in the "-n input image and let Dk(i,.i ) be the corresponding threshold of the dither matrix D- - nk. The brightness level of the display cell A(~,j) is determined according to the ~-n j) (k = 1,2,. . . , m - 1) as follows: comparison between B(~,j) and Ok(i,
A(i,j )
= 0
A(i,j )
k
~-"n when B(i,j ) <= Dl(i,j)
when D~(i,j)
A(i,j ) = m - 1
<
n B(i,j ) ~ Dk+l(i,j)
w h e n B(i,j ) > Jffn_l(i,j).
(m -- 1)n 2 + 1 pseudo halftones can be represented using (m - 1) n × n dither matrices. By modifying the threshold levels, contrast and brightness are controlled [1-3]. To ~-" j) ( k = 1,2, . .., r n - 1) of the control contrast and brightness, each element Dk(i, dither matrices is changed into/3~(o, O)(i, j) as follows: ~n Dk(o,
= [ o ( D % , . - M) +
(2)
where [x] denotes the maximum integer not greater than x. In Eq. (2), M is the median of the elements of dither matrices/ff~ (k = 1, 2 , . . . , m - 1), that is, M = L / 2 . Decreasing o gives higher contrast to the display since the threshold spacing is compressed. Decreasing p gives a brighter overall apparent brightness since all the thresholds shift lower. 3. E D G E E N H A N C E M E N T
The edges of a dithered picture are somewhat blurred. Heightening contrast makes the edges clearer, but the number of the apparent pseudo halftones decreases. If only the regions of the original image where the brightness severely changes are given higher contrast, the dither picture with accentuated edges can be displayed without decreasing the number of the apparent pseudo halftones. This section presents a method for partially controlling the contrast of a dithered picture. In this method, the changes of brightness in the disjoint n X n regions of the original image, each of which corresponds to an n X n dither matrix, are examined using entropy. A region where the brightness severely changes is compared with the dither matrices Dk(o, -" p) (k = 1,2,.. ., m - 1) with smaller o to heighten contrast
I M A G E E N H A N C E M E N T IN D I T H E R E D P I C T U R E
109
and a region where the brightness does not severely change is compared with the dither matrices Dk(o, -n p) (k = 1,2,. .., m - 1) with larger o. Let the brightness levels in an n x n region be, respectively, a~, a 2 , . . . , an2. Then the entropy H of the brightness in an n x n region of the original image is defined as follows: //2
H = - ~ Pilog2Pi/log2 n2
(3)
i=1
FIG. 1. Edge enhanced dithered picture. 4-level display, 4 X 4 dither matrices (o = 0.6, p = 80 when H<0anda=0.8,#= 80 w h e n H > O).
1 10
AKIRA SHIOZAKI
FIG. 2. Dithered pictures: (a) 4-level display, 4 × 4 dither matrices, nonenhanced; (b) 4-level display, 4 x 4 dither matrices, contrast and brightness controlled (o = 0.6, p = 80).
where n2
Pi = a i / Y'~ aj. j=l
T h e e n t r o p y H is n o r m a l i z e d so t h a t 0 __< H < 1. O b v i o u s l y , t h e e n t r o p y H is s m a l l
I M A G E E N H A N C E M E N T IN D I T H E R E D P I C T U R E
111
FIG. 2--Continued.
when the change of brightness in the region is severe and is large when the change of brightness is smooth. Therefore, the region is compared with the dither matrices Dk(O , ~ n P) (k = 1 , 2 , . . . , m - 1) with smaller o when the entropy H is less than or equal to a threshold 0, and is compared with the dither matrices Dk(o, -n p) (k = 1, 2 , . . . , m - 1) with larger o when the entropy H is greater than the threshold 0. An edge enhanced 4-level dithered picture is shown in Fig. 1. The original image is a monochrome picture with 256 × 256 pixels and 256 brightness levels. The dithered
112
AKIRA SHIOZAKI
M!I HM .111111111!!!11111111!!11111 II!111111111! I II! !1111111111111!1111!11111!1!1!11111 :Biii~i
~iiii~|.li:i:i:iiB:?Y:iiii~@!iiij; ~i~i]i~i~ii|liilit~,.i]:~?i~:~i:!iii|li~:~*|lli~:~i~ "ili ~i::~!::~ "~llil i'iiil" ~:i:~:~:i~iiijiii!ilmi~:~:~;~:i;~iil!il'iU IlZ~i;~i~i
-iii:il i,,ili,il!di[.:~!~!:~i',~,h!,~ii~ii~!ii!i:iiii' ~i~ ~iii~:i~!iii!i!iiii'i~l"lh"iiii!iiili
:::~:~i ilill
::-i.i!i,l..i.~ii!i!ii:ii~i!ii~,,.-~,,..i:i:i~ii!iii,.i~:~'~oiii:~i.:ii,Zipi,,iilii:i!~ii .,!i '° "°'" "
::~'i,,,dm,~,,tl?':'-
"ilil;,ii;,~,~,~iii<;::.::;:
:.:'~'- :
:.:
,
,,,,,,,!il ;iiE!ii!:i:~:~;~iii*~:~i~'~ii!i
:::'::~°~iiiiiiiiil,i.. ::!:Bi:~ i .ml,ll~.-.:~:i
-i~!,,iil,,,~,~,i!!ii:i:iii'i:i i.i!.i!.i!:l,,,I!,,!,!,!lll ::::-:*:-~=>~....~.,!!:=:iiiii
.i:i]i:i-: :.!i:'i.~:i]i'B:'i:i:i;!:~;i'i-:-i-~ i]ii~.:'o ii,iiiii-Iii ;:i~"iiiQjiliiIIl,!II~:i:Bi
IMAGE ENHANCEMENT IN DITHERED PICTURE
113
picture was displayed by repeatedly printing characters with a line-printer. It was processed with two sets of three 4 x 4 dither matrices: o = 0.6 and O = 80 when H < 0, o = 0.8 and O = 80 when H > 0, and the threshold 0 was an average of the entropies in the disjoint regions of the original image. Figures 2(a) and (b), respectively, show 4-level dithered pictures with 4 x 4 dither matrices D-4k ( 1 , 1 2 8 ) and/3~(0.6, 80). Figure 3(a) shows a 4-level dithered picture processed with three 4 X 4 dither matrices. The original image is a monochrome alphanumeric picture with 108 x 108 pixels and 64 brightness levels. Figure 3(b) shows an edge enhanced 4-level dithered picture processed with two sets of three 4 x 4 dither matrices: o = 0.4 and O = 32 when H < 0, o = 1.0 and 0 = 32 when H > 0 and the threshold 0 was an average of the entropies in the disjoint regions of the original image.
4. DISCUSSION AND CONCLUSION In the pseudo halftone display method using dither matrices, gray tone appears for the reason that the average brightness in a local area of the original image is proportional to that in the same local area of the displayed picture. The resolution of the displayed picture depends on the size of the dither matrices. Using dither matrices of large size gives a lot of pseudo halftones but reduces spatial resolution. In a dithered picture with a lot of pseudo halftones, edges are blurred and letters or drawings are indistinct. Edge enhancement of the input image before dither processing may make edges clearer in the dithered picture. The method presented here makes edges clearer by changing the thresholds of the dither matrices. The contrast of the dithered picture is partially controlled and edges are enhanced. As shown in Figs. 1 and 3, this method is effective for a gray tone image containing letters or drawings. The method has the advantage of simple operation and can display pictures of high quality. It is a very powerful and flexible image processing method. ACKNOWLEDGMENTS The author thanks Professor M. Onoe of the Institute of Industrial Science, University of Tokyo for supplying the standard image data, and Dr. M. Nagata of Osaka Electro-Communication University for his helpful suggestions. REFERENCES 1. C. N. Judice, Processing signals for digital displays, Bell Labs. Record 54, 1976, 75-79. 2. C. N. Judice, Digital video: A buffer-controlled dither processor for animated images, IEEE Tram.. Commun. COM-25, 1977, 1433-1440. 3. J. F. Jarvis, C. N. Judice, and W. H. Ninke, A survey of techniques for the display of continuous tone pictures on bilevel displays, Computer Graphics Image Processing 5, 1976, 13-40. 4. J. F. Jarvis and C. S. Roberts, A new technique for displaying continuous tone images on a bilevel display, IEEE Trans. Commun. COM-24, 1976, 891-898. 5. T. H. Morrin, A black-white representation of a gray-scalepicture, IEEE Trans. Comput. C-23, 1974, 184-186. 6. J. O. Limb, Design of dither waveforms for quantized visual signals, B.S.T.J. 48, 1969, 2555-2582.
FIG. 3. Dithered pictures: 4-leveldisplay, 4 × 4 dither matrices. (a) non-enhanced; (b) o = 0.4, p = 32 whenH=<0ando= 1.0,0=32whenH>6.