You are on page 1of 9

A simplified fractal image compression algorithm

A. selim*, M. M. Hadhoud$,, M. I. Dessouky# and F. E. Abd El-Samie#


*ERTU,Egypt
$
Dept. of Inform. Tech., Faculty of Computers and Information , Menoufia Univ., 32511, Shebin Elkom , Egypt.
# Dept. of Electronics and Elect. Communications., Fac. of Electronic Eng., Menoufia Univ., 32952, Menouf ,
Egypt.
E-mails: a_seleem_87@yahoo.com , mmhadhoud@yahoo.com and fathi_sayed@yahoo.com

ABSTRACT
This paper proposes a simplified fractal image compression algorithm on a
block by block basis. This algorithm achieves a compression ratio of up to 10 with
a peak signal to noise ratio PSNR as high as 35db. The idea of the proposed
algorithm is based on the segmentation of the image , first, into blocks to setup
reference blocks. The image is then decomposed again into block ranges and a
search is carried out to find the reference blocks with best match. The transmitted
values are the reference block values the indices of the range’s match. If there is no
match , the average value of the block range is transmitted. The advantage of the
proposed algorithm is the simple computation with high PSNR achieved.

Keywords: Cmopression, Fractal, Decomposition, Segmentation.

1 INTRODUCTION method based on fixed vector [1], [3], [5], [6]. Some
of them will briefly be explained in sections (2-1),
There are many techniques used to compress the and (2-2). In our proposed algorithm the image is
image and video, one of them is the fractal which is divided into equal squared regions, then search about
based on the partition of the image into regions or reference blocks in each region. The image again is
blocks. It doesn’t depend on the translation of the divided into block ranges. Then we search the
image to the frequency domain as deferential pulse reference blocks for a matched range, its indices is
code modulation DPCM, which depends on discrete transmitted instead of the range itself. If there is no
cosine transform DCT. DPCM suffers from blocking matched reference, the average of the range is
artifacts which is not the case in fractal code. The transmitted. In the decoder all the pixels of the range
image compression based on fractal image equal the average value. In this algorithm we don’t
compression (FIC) is one of the most popular use the count of the transformation which increases
modern image coding methods since 1988. It uses the complexity of the encoder; it uses the absolute
the self similarly method feature and has many difference to determine the similarity between the
characters such as, long coding time, fast decoding, blocks.
high compression ratio, and decoding image has no The resulted or decoded image is acceptable with
related to resolution [1,2,3]. Barnsly was the first one PSNR>30, at compression ratio=10. The main
who gave the attractor model of the two dimension advantage of the proposed algorithm is that it is a
affine transforms. He brought and developed simple in encoding and decoding. Our proposed
methods to compress the image based on the iterated algorithm is explained in section 3. Some results are
function system [8],[ 9], [10]. Generally FIC is a loss explained in section 4. Section 5 is for the
compression technique. Conclusion.
In fractal image compression, the image is divided
into numbers of block domains by any shape and any 2 Basics of Fractal Image Compression
size (usually 16x16 to 2x2) then the image is divided The word fractal was coined by Mandelbrot
again to block ranges with size less than that of block from the Latin word fractus, meaning broken, to
domain. There are many methods to obtain attractors describe objects that were too irregular to fit into
to decode the image. Some of these methods are, traditional geometrical settings. Several definitions
block segmentation, region segmentation and cross have been proposed. Mandelbrot defined a fractal to
searching; these expand self-similar fractal serial be a set with Hausdorff dimension strictly greater
image coding. Other methods are fast fractal image than its Euclidean dimension, i.e., a set for which
coding based on notably irevant check, image the only consistent description of its metric
compression and coding method based on fractal properties requires a “dimension” value larger than
dimension, and hierarchy fractal image compression our standard, intuitive definition of the set’s

Ubiquitous Computing and Communication Journal 1


“dimension.” A fractal has a fractional dimension; τ =∑τi (3)
thus some people say we get the word fractal from
fractional dimension. According to Bamsley, a Where 0< i≥ (N/aa x M/aa) is the number of block
fractal is a geometric form whose irregular details ranges
recur at different scales and angles which can be
described by affine or fractal transforms. Various The processing of FIC is for each range block Ri,
other definitions have been proposed, but they are search the domain pool for a block domain which has
not complete in that they exclude a number of sets minimum distortion (di) after the transformation and
that clearly ought to be regarded as fractals. the transform τi which has the minimum di is the
Falconer proposed that it is best to regard a compression code
fractal as a set that has properties such as those
listed below, rather than to look for a precise 2.2 Region segmentation
definition which will almost certainly exclude some In this method the image is decomposed into regions
interesting cases. Typical properties of a fractal are -instead of blocks in the BS method-these regions are
1. It has a fine structure, i.e., details on called Ri with any size and any shape, τi is the affine
arbitrarily small scales. transform from Di (block domain) to Ri and τ; is the
2. It is too irregular to be described in total transformation defined by equ.3.
traditional geometrical language, both The FIC processing is to find affine transform τi(Di)
locally and globally. such that the distortion between Di and Ri is defined
3. It usually has some form of self-similarity, by
perhaps approximate or statistical.
4. Its fractal dimension (Hausdorff d(Ri ,τi(Di))<τi (4)
dimension) is usually higher than its
Euclidean dimension. Then the transformations τ are transmitted or saved,
5. In most cases of interest, a fractal is which can be used to decode the image at the
defined in a very simple way, perhaps decoder [1,5].
recursively.
3 The proposed algorithm
In block segmentation (BS) fractal compression The proposed algorithm is based on block and region
methods, the image of size (N x M) is decomposed segmentation. The steps of the algorithm are as
into partitions follows;
1- Load an image of size N x M, if (N/a), and (M/b)
2 Types of segmentations are not integer numbers, we extend the image to
become of reasonable size for each block.
2.1 Block based FIC 2-Decompose the image into block domains D (i , j)
In block segmentation (BS) fractal compression with size (a x b), (a=b=16 or 8) as in fig.1. Where,
methods the image of size (N x M) is decomposed
into partitions (blocks in this case) called block i=1:N/a , and j=1:M/b.
domain pool D, each block domain Di of size (a x b)
is; 3-Compare all block domains in each region
Di; where 0 <i ≤ N1; and N1 is the number of the segmented (which are colored with red, green…) to
domain blocks detect which of the domain blocks may be used as a
reference.
N1=(NxM)/(axb) (1) The test is based on the distortion which is given by

To code the image we decompose it again into block d(D(i,j),D((i+t),(j+w)); (5)


ranges Ri with size (aa x bb) less than the size of Di.
Each block range Ri has the image transform τi, Where t, and w=-1, or 1
which is also called the compressive code of the
range block, and contains two parts: gray (Ti), and This compared to a threshold (thsh) Fig.2.
geometry (Si) transform or; 4- Make a domain pool to be transmitted or saved.

τi=Ti+Si (2) [D1, D2…Di1….DNRB]=[RB(1,1),RB(1,2),…..RB( i , j


),…RB(N/a,M/b)] (6)
and the total transformation of the total ranges of the
image τ; these transformations saved in or Where NRB is the Number of Reference Blocks.
transmitted to decoder Instead of saving or
transmitting the whole block range[1],[4], where τ is 5-Decompose each reference block domain into
blocks called reference ranges Rref of size (aa, bb),

Ubiquitous Computing and Communication Journal 2


which will be saved or transmitted directly without and the threshold takes values from 0.01 to 10.
processing. The decoded “pout” images are shown in figs.4 to
6-Count the number of pixels of the transmitted 13, and the original image in Fig.3. The original
reference blocks (Ref. Pix); “Saturn” image is shown in fig. 14, and its decoded
images are shown in Fig.15 to 25.
Ref. Pix= NRB x (a x b) (7) -The resulted compression ratios are change from 3
to 10, where PSNR s are ranges from 12 to 35 for
7-Decompose the image again into block ranges R of “Saturn”
size (aa x bb) (usually aa=bb=4). - For “pout” image the CR changes from3.5 up to 7
and PSNR from 13 up to 31
8-For each block range Ri search the reference block -The decoded images are accepted especially at
ranges in the region of this range, if there is no higher PSNR (> 20).
matched range, search other reference block ranges - Fig.26 and Fig.27 show the relation between PSNR
Rref in the other regions. versus CR for the two images
- As expected the PSNR decreased by increasing the
9-Find the indices of this matched reference (dx , dy), threshold which means that we are increase the
transmit or save it. distortion in the decoded image and this is a logical
relation. The curves which shows the relation
10-Count the number of pixels which is used to between the PSNR and the threshold are shown in
transmit or save the range block (Range pix); Fig.28 and Fig.29.
The resulted decoded images are acceptable with a
Range pix=2x(number of matched ranges) (8) CR =10 or 7 in the tow cases.
This algorithm mainly gives the simplification in
Transmit the average of the block range. encoding the image which is complexity and
consumes a lot of times.
12-Count the number of pixels which is used to Usually the relation between the PSNR and CR is,
transmit averaged blocks (av. Pix); decreasing in PSNR with increasing in CR, but in
our results the PSNR increases with increasing in
av.pix = number of averaged blocks (9) CR.
The explanation of this case is;
13-The total number of transmitted or saved pixels, For each range we are searching the domain pool
(eqs.6, 7, 8); (reference domain) for a matching reference range
using a certain threshold (thsh.), if the distortion
dN = av.pix + Range pix + ref. pix (10) between the range and it’s matched range less than
the threshold, we replace the range by its matched
14-The compression ratio is; reference range and transmit it. It is not the same but
the distortion between them is less than the
CR=(NxM)/dN threshold. Which decrease the PSNR.
(11) If there is no matched range with distortion less than
the threshold we transmit the average of the range.
15-After decoding the image, compute the peak The average is one value (also the number of the
signal to noise ratio PSNR range which has a matched range is decreased) so
PSNR = 10 log ( ∑N,M (original image’s pixels – CR increase with increasing PSNR.
decoded image’s pixels)) / (number of the original We can consider that it is a processing of searching
image’s pixels) ………… (12) for an optimum values to compress the image, then
we use only this point or the value of threshold.
4 Experimental Results We can consider that it is a processing of searching
It is obvious that the algorithm doesn’t search for the for an optimum values to compress the image, and
affine transforms of each range block; it is directly then we use only this point or the value of threshold.
search for similarity between the range block and a This algorithm gives a new method to encode the
reference block in a reference domain based on the image in which instead of use the old iterated
distortion ( eq.5). methods we transmit the average of the range for
-We used two of Mat Lab images “Saturn” and simplification.
“pout” of sizes ( 328 x 438)and (291 x 240 ) The resulted CR is more than that resulted by some
respectively . other methods as spiral architecture [3].
These sizes are extended to (336x448) and The time consumed to encode and decode the image
(304x240) respectively. by the proposed algorithm is 16 sec in case of block
The sizes of the block domain used are a = b = 16 size of 16x16 and 46 sec in case of 8x8. It is very
and 8, the size of the range blocks is, aa x bb=4x4, fast if we compare this time with times consumed by

Ubiquitous Computing and Communication Journal 3


many other fractal methods which may be thousands 3- Xiangjian He, Huaqing Wang: `Fractal image
of sec. [2] compression on Spiral Architecture` (CGIV`06) 0-
7695-2606-3/06 $20.00 2006 IEEE
4- Barnsly M F A D.: A Better way to compress
5 Conclusion image byte, 1988.
The paper proposed a simplified fractal image 5- A Is M, Clarkson T.: Survey of block based
compression algorithm. The computational fractal image compression and its application.
complexity of this algorithm is small. The achieved 6- A.E.Jacquin,: image coding based on fractal
compression ratio using this algorithm is moderate. theory of Iterated. Contractive image
Experimental results show that algorithm can be used transformations, IEEE Trans. On image processing,
as a fast fractal based compression algorithm with 18-30,1992.
high efficiency. 7- Y. Fisher (editor),: fractal image compression-
6 References theory and applications. Springer-verlag, new york,
USA, 1995.
1- Erjun Zhao Dan Liu: `Fractal image compression 8- Ning lu, :Fractal imaging, academic press, new
methods: A review` (ICITA`05) 0-7695-2316-1/05 york,1997
$20.00 2005 IEEE 9- Brent Wohlberg and Gerhard de Jager: A review
2- Kin-wah ching Eugene and Ghim-Hwee Ong: `A of the Fractal Image Coding Literature, IEEE trans.
two-pass improved encoding scheme for fractal On image processing, vol.8,no.12, December 1999.
image compression` (CGIV`06) 0-7695-2606-3/06 10-Barnsley M F, Sloan A D.A: better way to
$20.00 2006 IEEE compress images Byte,1988.

Ubiquitous Computing and Communication Journal 4


D(1,1) D(1,2) D(1,3) D(1,4) D(1,5) D(1,6) D(1,7) ……
D(2,1) D(2,3) D(2,3) D(2,4) D(2,5) D(2,6) D(2,7) …....
D(3,1) D(3,2) D(3,3) D(3,4) D(3,5) D(3.6) D(3,7) ……
D(4,1) D(4,2) D(4,3) D(4,4) D(4,5) D(4,6) D(4,7) ……
D(5,1) D(5,2) D(5,3) D(5,4) D(5,5) D(5,6) D(5,7)
D(6,1) D(6,2) D(6,3) D(6,4) D(6,5) D(6,6) D(6,7)
D(7,1) D(7,2) D(7,3) D(7,4) D(7,5) D(7,6) D(7,7)
. . . . . . . ………
. . . . . . . ……….
. . . . . . . …..

Figure 1: Block segmentation and block reference searching

……

…....
RB(1,1) RB(1,2)
……

……

RB(2,1) RB(2,2)

. . . . . . . ……
. . . . . . . …
. . . . . . . ……
. . . . . ….
…..

Figure 2: Reference blocks in each region

Ubiquitous Computing and Communication Journal 2


Figure 3: The original image Figure :4 Thsh=0.01, CR=7 Figure 5: Thsh=0.1, CR=6.18
PSNR=31, a=b=16, aa=bb=4 PSNR=30.95, a=b=16, aa=bb=4

Figure 6: Thsh=0.5, CR=4.22 Figure 7: Thsh=1, CR=4.13 Figure 8: Thsh=2, CR=3.8


PSNR=29.6, a=b=16, aa=bb=4 PSNR=26.6, a=b=16, aa=bb=4 PSNR=21.5, a=b=16, aa=bb=4

Figure 9: Thsh=1, CR=2.6 Figure 10: Thsh=2, CR=3.2989 Figure 11: Thsh=0.5, CR =2.1
PSNR=26.7 a=b=8 aa=bb=4 PSNR =20.6, a=b=8, aa=bb=4 PSNR=29.2, a=b=8, aa=bb=4

Ubiquitous Computing and Communication Journal 3


Figure 12: Thsh=0.1, CR =5.2 Figure 13: Thsh=0.01,CR =7.2
PSNR =30.5, a=b=8, aa=bb=4 PSNR =34.6, a=b=8, aa=bb=4

Figure 14: The original image Figure 15: Thsh=0.01, CR=9.86, Figure 16: Thsh=5,CR=9.2,
PSNR=35.7,a=b=16,aa=bb=4 PSNR=27.5,a=b=16,aa=bb=4

Figure 19: Thsh=8,CR=8.7,


Figure 17: thsh=4, CR=9.34, Figure 18: thsh=1, CR=9.71, PSNR=17.7, a=b=16, aa=bb=4
PSNR=30.9, a==b=16, aa=bb=4 PSNR=35.7, a=b=16, aa=bb=4

Figure 20: thsh=0.1, CR=9.8, Figure 21: thsh=0.5, CR=9.75, Figure 22: Thsh=10, CR=8.4,
PSNR=35.7, a=b=16,aa=bb=4 PSNR=35.8, a=b=16,aa=bb=4 PSNR=13.1, a=b=16, aa=bb=4

Ubiquitous Computing and Communication Journal 4


Figure 25: Thsh=0.0,1 CR=10.1,
Figure 24: Thsh=0.1, CR=10, PSNR=34.6 a=b=8 aa=bb=4
Figure 23: Thsh=0.5, CR=9.99, PSNR=34.6, a=b=8, aa=bb=4
PSNR=34.6, a=b=8, aa=bb=4

cr vs. PSNR for "saturn" image cr vs. PSNR for "pout" image
40 31

30
35
29

28
30
27

PSNR
PSNR

25 26

25

20 24

23
15
22

21
10 3.5 4 4.5 5 5.5 6 6.5 7
8.4 8.6 8.8 9 9.2 9.4 9.6 9.8 10 CR
CR

Figure 27: CR versus PSNR for “pout” image


Figure 26: CR versus PSNR for “saturn” image

Ubiquitous Computing and Communication Journal 5


thsh vs. PSNR for "saturn" image
40
thsh vs. PSNR for "pout" image
31

30 35

29

30
28

27

P S NR
25
PSNR

26

25
20
24

23 15
22

21 10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 1 2 3 4 5 6 7 8 9 10
thsh thsh

Figure 28: PSNR versus threshold for “saturn” image Figure 29: PSNR versus threshold for “saturn” image

Ubiquitous Computing and Communication Journal 6

You might also like