You are on page 1of 17

Project Report

Phase-1

Fractal image compression

Submitted by
BALARAM. A (08410209).

Under the guidance of


Dr. K.KARTHIK

To
Department of Electronics and communication Engineering
IIT GUWAHATI.
Abstract

Fractal image compression is a new technique for encoding images compactly based
on affine contractive transforms. It builds on local self-similarities with in image. Self-
similarity refers to objects that have several parts looking as the whole object. Self-
similarity is the typical property of fractals. Image blocks are seen as rescaled and
intensity transformed approximate copies of blocks found where else in image. This
yields a self-referential description of image data, which when decoded shows a typical
fractal structure. This report demonstrates the basics of fractals, affine transformations,
and a simple algorithm to compress and decompress the image. It also demonstrates the
compression algorithms to fasten the encoding time and to improve the quality of
reconstructed image.

1. Introduction:

Fractal is first introduced in geometry field. The birth of fractal geometry is usually
traced back to the IBM mathematician Benoit B. Mandelbrot and the 1977 publication of
his book “The Fractal Geometry of Nature”. Later, Michael Barnsley, a leading
researcher from Georgia Tech, found a way of applying this idea to data representation
and compression with the mathematics of Iterated Functions Systems (IFS). Regarding
the computational complexity, fractal compression algorithm based on IFS was still not
practical to use at that time. And it is Arnode Jacquin, who finally settled down this
problem with Partitioned Iterated Function Systems (PIFS), which is modified from IFS
by partitioning the domain space into subspaces.
Wohlberg and de Jager conclude that the fundamental principle of fractal coding
consists of the representation of an image by a contractive transform of which the fixed
point is close to that image at their review. By the contractive mapping theorem and
collage theorem, the contractive transform is always possible within certain threshold.
Original approach taken IFS tries to find a number of affine mappings on the entire
image, which is rather slow in terms of searching the contractive map function. Jacquin’s
PFIS takes different approach to find the individual mappings for subsets of the images.
The partition of the image has been introduced to get those subsets. The main concept is
to partition the image space twice as “range blocks” and “domain blocks”. Both partitions
follow the same scheme in geometric sense covering the whole image, but the latter is
allowed to overlap with each other. Then each range block is mapped onto one domain
block by taking certain transformations such as rotation, flip, etc. One mapping is
eventually identified by two variables, named scaling and offset. Most cases are
measured by distance between points under MSE (Mean-Squared Error) [1] [2] [3]

2. Basic concepts

2.1. Attractor and Self-similarity

Fractals have provided a different description of objects, which is completely different


from traditional concepts. Fractal theory concentrates on the “self-similarity” of objects, so
it can theoretically be used to describe the inside features of different images rather than
something on the “surface”. Therefore the route of compression by means of the fractal is
different from traditional compression methods. An intuitive example would be a
photocopying machine (Fisher 1992). Imagine a copying machine that reduces the image to
be copied by one half and reproduces it three times on the copy tray (Figure 2.1). When we
feed the output of this machine back as input, we will find that all the copies seem to be
converging to the same final image after several iterations of this process on several input
images (Figure 2.2). This final image is called the attractor for this copying machine.
Because the copying machine reduces the input image, any initial image will be reduced to
a point as we repeatedly run the machine. Thus no matter what initial image is placed on
the copying machine, it will not affect the final attractor. In fact, only the position and the
orientation of the copies determine what the final image will look like.
From the copies, it can be seen that each copy is formed of three reduced copies of
itself. A common feature of these reduced copies and all attractors formed this way is that
in the position of each of the images of the original square there is a transformed copy of
the whole image. So each image is formed from transformed (and reduced copies) of itself
and hence it has the same detail at every scale. This is “self-similarity”, the unique and
important feature of fractal.
2.2. Contractive transformation
Since the way the input image is transformed determines the final result of running the
copy machine in a feedback loop, the transformation will be described. Different
transformations will lead to different attractors(final images), provided the transformations
must be contractive, that is, given a transformation W, any two points P1, P2, in the input
image must be closer in the copy . In other words, the distance between the two points:

d (W ( P1 , )W ( P2 )) < sd ( P1, P2 ) (2.1)

This condition is natural and obvious, because if the transformation is not contractive,
points in the copy will be spread out. It follows the final image will be of infinite size.
Except for this condition, the transformation can have any form. In practice, the
transformation can be affine, which will be sufficient to yield interesting set of attractors:

 x  a bi   xi   ei 
wi   =  i   +  
 y   ci di  yi   fi 

(2.2)

Contractive transformations have the pleasing property such that when they are
repeatedly applied, they converge to a point. This point remains fixed when further
iterations are applied.
The contractive mapping fixed point of transformations theorem says that something
that is intuitively obvious: if a map is contractive then when we apply it repeatedly
starting with any initial point we converge to a unique fixed point.
Figure 2.1 Copy machine
Figure 2.2 Different initial images with similar final images

2.3. Advantages and Disadvantages of fractal image compression


When the fractal image compression is compared to other methods used to compress
different images, some of the main advantages and disadvantages can be summarized.

2.3.1. Advantages
• Good mathematical encoding frame.
• Resolution-free decoding.
• High compression ratio
• Quick decompression.
2.3.2. Disadvantages
• Slow encoding
• Computational complexity

2.4. Self similarity in images


A typical image of a face, for example figure 2.3 does not contain the type of self-
similarity that can be found in the fractals. The image does not appear to contain affine
transformations of itself. But, in infact, this image does contain a different sort of self-
similarity. Figure 2.3 shows sample regions of Lena which are similar at different scales,
a portion of her shoulder overlaps a region that is almost identical, and a portion of the
reflection of the hat in the mirror is similar(after transformation) to a part of her hat. The
distinction from the kind of self-similarity we saw in figure 2.3 is that rather than having
the image be formed of copies of its whole self( under appropriate affine transformation),
here the image will be formed of copies of properly transformed parts of itself. This
means that the image we encode as a set of transformations will not be an identical copy
of the original image but rather an approximation of it. Experimental results suggest that
most images that one would expect to “see” can be compressed by taking advantage of
this type of self-similarity; for example, images of trees, faces, houses, mountains,
clouds, etc[4].

Figure 2.3 the original Lena image and its self similar portions

3. Fractal image compression


3.1. General procedure

The image compression procedure is in fact an image encoding process while the
reconstructing or restoring procedure corresponds to image decoding. Let (M, d) denote a
metric space of digital images, where d is the distance measure (which is invariant to
translation and rotation) in the given space. Let U be an original image that we want to
encode or compress. We need to find a contractive image transformation T, defined from
the space (M, d) to itself, for which U is an approximate fixed point. So, there exists a
number s < 1 such that for any u, v belonging to (M, d). Let (M, d) denote a metric space
of digital images, where d is the distance measure (which is invariant to translation and
rotation) in the given space. Let U be an original image that we want to encode or
compress. We need to find a contractive image transformation T, defined from the space
(M, d) to itself, for which U is an approximate fixed point. So, there exists a number s <
1 such that for any u, v belonging to (M, d), we have

d (T (u ), T (v)) ≤ sd (u , v) (3.1)
and
d (U , T (U )) ≈ o (3.2)

The scalar s is called the contractivity of the transformation T. By repeated


application of the triangular inequality in (M, d) and user of the contractivity of T, it is
easy to have:
1
d (U , T n (U 0 )) ≤ d (U , T (U )) + S n d (U ,U0) (3.3)
1− s

then, from (3-1) and (3-2), and since s < 1, after a number of initial iterations, we will
have:
{U n = T n (U 0 )}n ≥0 (3.4)

where U0 is an arbitrary initial image. The sequence of Un converges to a stable image,


as the result of its iterative construction. So if a suitable T is chosen, it can be expected
that the original image will be reconstructed as close approximation through a series of T
transformations from an initial image, which could be much simpler than the original
image itself. In other words, after a series of T transformations, the initial image will
converge to the original one. Reconstruction can be accomplished by partitioning the
original image in a suitable manner that will obtain the suitable transformation T to meet
the requirement of compression rate and computational issues. So the task of
compressing an image includes three important parts:
1) Partition the image and find transformations for each partitioned part;
2) Encoding (compressing) the image; and
3) Decoding (decompressing) the image.

3.2. Partitioning images


It is crucial to choose a suitable way of partitioning images or a suitable image data
structure, because the method of partitioning images is closely related to the next step:
algorithm development issue. The format of the data determines the manner of obtaining
the data and the processing methods most effectively used upon the data. If an accurate
method of partitioning image data is chosen for a specific issue, then the solution of the
issue will be simplified.

3.2.1. Fixed size block partitioning

The image is partitioned into un-overlapped range blocks ( Ri ) and the overlapped

domain blocks ( Di ). Generally, the size of the domain block is two times of the range
block. Then, matching operation is performed on these blocks, which will generate the

IFS. For each range block ( Ri ), search for the most suited domain block ( Di ) and the

compressed mapping transformation ( wi ), making the transformed domain block be


closest to the range block, namely,
wi ( Ri ) ≈ Di

3.2.1. Adaptive quadtree partition method

In the adaptive quadtree partition method, the image is divided into four sub blocks
with equal size which are joined by four nodes, and these sub blocks are judged to be
subdivided or not according to their statistical properties. Figure 1 shows a process of the
quad tree partition. The quadtree partition is only performed on the sub blocks where the
error is above the given threshold. Thus, the block is small for quickly changing areas in
the image, and the block is large in the flat regions.
4. Problem definition

In the traditional fractal image compression method, the increase of the compression
ratio, encoding time and the improvement of the quality of there constructed image are
often contradictory.
If the size of the block is taken small which will increase the no of total blocks and the
IFS parameters, thus the coding time will be increased and compression ratio will be
decreased correspondingly. If the size of the block is taken as bigger this will decrease
the quality of reconstructed image.

1. Here the problem is to find out the algorithm with good partition scheme and searching
process to fasten the encoding process with good compression ratio and quality of
reconstructed image

2. The greatest disadvantage of fractal based compression is its very long time consuming
our aim to reduce the time complexity

5.1 Fractal compression based on fixed block size and sequential search
The fractal encoder with fixed block size operates in the following steps

1. Firstly, the image is partitioned into un-overlapped range blocks ( Ri ) and the

overlapped domain blocks ( Di ). Generally, the size of the domain block is four
times of the range block.
2. Then, matching operation is performed on these blocks, which will generate the IFS.
3. For each range block ( Ri ), search for the most suited domain block ( Di )
sequentially over entire domain pool, and the compressed mapping transformation (
wi ), making the transformed domain block be closest to the range block, namely,

wi ( Ri ) ≈ Di . Finally, store the IFS of each range block.

R ≈ sD + g ≈ w( Di ) (5.1)

4. The compressed mapping transformation ( wi ) includes the spatial scaling, spatial


position and luminance transformations. The spatial scaling transformation is used
to compress the domain block in space, and is generally taken as the average of the
adjacent four pixels. The spatial position transformation is the eight affine
transformations proposed by Jacquin [8]. The luminance transformations are
determined by the scaling factor (S) and the offset (g), which may be solved through

the least squares method. For an image with size of M×N pixels, if dij is the pixel of

the transformed domain block by wi and rig is the pixel of the range block, the
error measurement will be given as:
N M
err = ∑∑ ( s.dij + g − rij ) 2 (5. 2)
i =1 j =1

5. The reconstruction process of the original image consists on the applications of the
transformations describe in the fractal code book iteratively to some initial image Ωinit,
until the encoded image is retrieved back. The transformation over the whole initial
image can be described as follows
Ω1 = W (Ωinit)
Ω2 = W (Ω1)
Ω3 = W(Ω2)
..... = ......
Ωn = W(Ωn-1) (5.3)
In this method, in order to improve the quality of the reconstructed image, the block
size is taken small, which will increase the number of the total blocks and the IFS
parameters, thus, the coding time will be increased and the compression ratio will be
decreased correspondingly. Each range block will be compared to all the transformations
of each domain blocks, which also increases the coding time.
5.1.1. Results

5.2. Fractal compression based on fixed block size and random search

The fractal encoder with fixed block size operates in the following steps

1. Firstly, the image is partitioned into un-overlapped range blocks ( Ri ) and the

overlapped domain blocks ( Di ). Generally, the size of the domain block is four
times of the range block.
2. Then, matching operation is performed on these blocks, which will generate the
IFS.
3. In random search process we will take a set of domain blocks from domain pool

say N blocks. For each range block ( Ri ), search for the most suited domain block

( Di ) is carried only in those N domain blocks, and the compressed mapping

transformation ( wi ), making the transformed domain block be closest to the range

block, namely wi ( Ri ) ≈ Di Finally, store the IFS of each range block.


R ≈ sD + g ≈ w( Di ) (5.4)
4. The compressed mapping transformation ( wi ) includes the spatial scaling, spatial
position and luminance transformations. The spatial scaling transformation is used
to compress the domain block in space, and is generally taken as the average of
the adjacent four pixels. The spatial position transformation is the eight affine
transformations proposed by Jacquin [8]. The luminance transformations are
determined by the scaling factor (S) and the offset (g), which may be solved
through the least squares method. For an image with size of M×N pixels, if dij is

the pixel of the transformed domain block by wi and rij is the pixel of the range
block, the error measurement will be given as:

N M
err = ∑∑ ( s.dij + g − rij ) 2 (5.5)
i =1 j =1

5. The reconstruction process of the original image consists on the applications of the
transformations describe in the fractal code book iteratively to some initial image Ωinit,
until the encoded image is retrieved back. The transformation over the whole initial
image can be described as follows
Ω1 = W(Ωinit)
Ω2 = W(Ω1)
Ω3 = W(Ω2)
..... = ......
Ωn = W(Ωn-1) (5.6)

The basic difference between previous and current method is only searching process
in this method we are not searching entire domain pool for best possible matching block,
here we are searching in a subset of domain pool. This method gives us the fast encoding
times, no change in compression ratio and reconstructed image quality is going to
decrease compared to previous method
5.3. Fractal compression based on Adaptive quadtree partitioning
In order to decrease the coding time, many methods are proposed by changing the
searching means while block matching. Namely, the range block needn’t be compared to
the transformations of all domain blocks. However, as the size of the blocks is fixed, the
compression ratio, the quality of the reconstructed image and the coding time are
contradictory.

1. In the adaptive quadtree partition method, the image is divided into four
subblocks with equal size which are joined by four nodes, and these subblocks are
judged to be subdivided or not according to their statistical properties
2. The quadtree partition is only performed on the subblocks where the error is
above the given threshold. Thus, the block is small for quickly changing areas in
the image, and the block is large in the flat regions.
3. After partitioning we will get number of domain blocks and range blocks of
different sizes.
4. Searching for the best possible domain block for each range block is carried out

and store the affine transform for each range block Ri


Ri ≈ sD + g ≈ w( Di ) (5.7)

5. The reconstruction process of the original image consists on the applications of the
transformations describe in the fractal code book iteratively to some initial image Ωinit,
until the encoded image is retrieved back. The transformation over the whole initial
image can be described as follows
Ω1 = W(Ωinit)
Ω2 = W(Ω1)
Ω3 = W(Ω2)
..... = ......
Ωn = W(Ωn-1) (5.8)
In this method of fractal compression the encoding process compression ratio is less
compared to previous two methods and the reconstructed image quality of decoding
process is good.
5.4. Fractal compression based on block classifier and adaptive
quadtree partitioning

In order to reduce the searching time during the matching process in the quadtree
partition method, the sub blocks are classified in each level. For the range blocks, they
are classified directly. For the domain blocks, they are transformed by spatial scaling and
spatial position transformations before classifying.
The classification method is described as below. Firstly, divide each sub block into four
equal parts, and calculate the mean value and the variance of each part. Then, according
to the mean values, the subb locks are classified into 3 main classes.
classI : µ1 ≥ µ2 ≥ µ3 ≥ µ4 ;

classII : µ1 ≥ µ2 ≥ µ4 ≥ µ3 ;

classIII : µ1 ≥ µ4 ≥ µ2 ≥ µ3 ;

Finally, according to the descending order permutation of the variances ( δ1 , δ 2 , δ 3,δ 4 ),


each main classes are divided into 24 auxiliary classes. In this way, each sub blocks are
divided into 72 classes.

The description of this algorithm is as follows:

Step1. Set the maximum and minimum recursion depth and the error threshold;

Step2. The adaptive quadtree partition is performed on the image. The domain blocks
and the range blocks in each level are classified.

Step3. Each range blocks are compared with the domain blocks which have the same
class as the current range block. If the error is below the given threshold, record the
corresponding parameters; otherwise, jump to Step 2.
In this method of compression the compression ratio, encoding time is better compared
to adaptive quadtree portioning and the reconstructed image quality is good compared to
all the previous methods.

6. Future work and conclusions


Fractal compression using fixed size block and sequential search has simulated and
results are tabulated. For fixed size block based compression has good compression ratio
with very slow encoding process. Future work is to find the results using fixed size block
random search and quadtree partitioning method, and to find the better algorithm with
good partition scheme and searching process to fasten the encoding process with good
compression ratio and quality of reconstructed image

You might also like