Professional Documents
Culture Documents
A Better Way to
Compress Images
Mathematics is providing a novel technique for achieving
compression ratios of 10, 000 to 1-and higher
Figure 3: IFS-encoded color photo of a Figure 4: IFS-encoded color photo of Figure 5: IFS-encoded color image
Bolivian girl (120 transformations, 2000 the Monterey coast (60 transformations, from A Cloud Study (30
photographs © 1987 Georgia Tech Research Corp. Figure 1: Barnsley;
Figures 2 and 3: Barnsley, lacquin, Malassenet. Rarer, Sloan;
Figures 4 and 5: Barnsley, Jarquin, Reuter, Sloan.
IMAGE COMPRESSION
W [Yx] _ Ca d ] [ x Y ] + al a+a2b+e=
0,a+a2b+e=
-y,a+_y2b+e =1 ',,
_ ax+by+e - I
cx+dy+f I ' and find c , d , and f in similar
fashion from these equations:
where the coefficients a, b, c, a,c+a2d + f = a2, (4)
d , e, and f are real numbers. 0,c+02d + f = N2, (5)
If we know in advance the y,c+ti2d + f = y 2. (6)
translations, rotations, and
scalings that combine to We recommend the use of an
produce W, we can generate equation solver such as TK
coefficient values as follows: Solver Plus (Universal
a = r cos 6, b = -s sin Technical Systems, Rockford, Figure 6: An aff ne
~, c=rsin0,d=scos0, Illinois) or Eureka (Borland transformation W moves the
International, Scoffs Valley, smiling face F to a new face
where r is the scaling factor on California) for finding the W(F). The transformation is
x, s is the scaling factor on y, 9 coefficient values. Doing it called contractive because it
is the angle of rotation on x, 0 manually can be tedious. moves points closer
is the angle of rotation on y, e Now that we know what a
is the translation on x, and f i s
the translation on y.
How can you find an affine
transformation that produces a ((31,82)
desired effect? Let's show how
to find the affine trans-
formation that takes the big ~ - ( « 1 , C - 0
leaf to the little leaf in figure 7. fY1,l`z) _ i- (a~,az)
We wish to find the numbers a,
b, c,W(big
d, e, leaf)
and =f for
littlewhich
leaf. the
Begin by introducing x and y
coordinate axes, as already
shown in the figure. Mark three
points on the big leaf (we've
chosen the leaf tip, a side
spike, and the point where the
stem joins the leaf) and
determine their coordinates
(a,,a2), (N1,N2), and (y,,72).
Mark the corresponding points
on the little leaf and determine
Determine values for the
coefficients a, b, and e by Figure 7: Two leaves fix an affine
solving the three linear ivy
equations transformation W.
affine transformation is and formations. In the present case (i) Initialize: x=0, y=0.
how to find one that maps a we might have p,, ps, and p,.
source image onto a desired Notice that the probabilities (ii) For n=1 to 2500, do steps
target image, we can describe must add up to 1. That is, p, + (iii)-(vii). (iii) Choose k to be one
p,+p,=1.
an iterated function system. An of the numbers 1, 2 , . . ., m,
IFS is a collection of Of course, the above with probability P,
contractive affine transforma- notation for an IFS is (iv) Apply the transformation
tions. Here's an example of an cumbersome. Table 1 y=y.
IFS of three transformations: expresses the same
W' 1yI _ [0.0 0.5] Cy] + [00] ' information in tabular form. (vi) If n > 10, plot
Other examples of IFS codes
are given in tables 2 through 4. Applying this procedure to the
The Random Iteration transformation in table 1
WZ Cy] = [o:o oa] Cy] + Co] ' Algorithm Now let's see how to produces the figure shown in
decode an arbitrary IFS code figure 8-a fractal known as the
using the random iteration Sierpinski triangle. Increasing
W, [y] _ 00 0.5 Cy] + 1.55] method. Remember that in the number of iterations n adds
general an IFS can contain any points to the image. Figure 9
Each transformation must also number, say m, of affine shows the result of the random
have an associated probability, transformations, W,, W 2 , iteration algorithm applied to
pi, determining its W3,.. ., W,., each with an the data in table 3, at several
"importance" relative to the associated probability. The stages during the process. By
increasing the scale factor used
in plotting, you can zoom in on
the image (see figure 10). The
text box on page 221 contains
a BASIC implementation of the
method with additional com-
ments on programming.
You may wonder why the first
10 points are not plotted (step
(vi)). This is to give the
randomly dancing point time to
settle down on the image. It is
like a soccer ball thrown onto a
field of expert players: Until
someone gains control of the
ball, its motion is
unpredictable, or at least is
independent of the players' ac-
Figure 8: The result of applying the random iteration algorithm to the IFS tions. But eventually a player
code in table 1. It is called the Sierpinski triangle. gets the ball, and its motion
then becomes a direct result of
the skill of the players. The fact
Figure 9: A fern appears when the random iteration algorithm is applied to the IFS code in
table 3.
IMAGE COMPRESSION
at on algorithm will produce plane, with its vertices at (0,0), tions 1 through 3 and 4
the same image over and over (1,0), (1, 1), and (0,1) (see through 6. The values one
again, independent of the figure 11). The objective is to
particular sequence of random choose a set of contractive af- finds in the present case are
choices that are made? This fine transformations, in this given in table 2. When the
remarkable result was first case W , W2, W,, W4, so that S random iteration algorithm is
suggested by computer-graph- is approximated as well as applied to this IFS code, the
ical mathematics experiments possible by the union of the
and later given a rigorous four subimages WI(S) U W2(S) square is regenerated.
theoretical foundation by U W3(S) U W4(S). Figure 11 The preceding example
The Collage Theorem typifies the general situation:
shows, on the left, S together
with four noncovering affine You need to find a set of affine
Our next goal is to show a transformations of it; on the transformations that shrink dis-
systematic method for finding right, the affine trans- tances and that cause the
the affine transformations that formations have been adjusted target image to be
will produce an IFS encoding of to make the union of the approximated by the union of
a desired image. This is transformed images cover up the affine transformations of
achieved with the help of the the square. the image. The Collage
Collage Theorem. Theorem says that the more
To find the coefficients of these accurately the image is
described in this way, the more
accurately the transformations
provide an IFS encoding of it.
Figure 12 provides another
illustration of the Collage
Theorem. At the bottom left is
shown a polygonalized leaf
boundary, together with four
affine transformations of that
boundary. The transformed
leaves taken together do not
form a very good
approximation of the leaf, in
consequence, the
corresponding IFS image
(bottom right), computed using
the random iteration algorithm,
does not look much like the
original leaf image. However,
as the collage is made more
accurate (upper left), the
decoded image (upper right)
becomes more accurate.
So, there's a fundamental
stability here. You don't have
to get the IFS code exactly
Figure 10: Successive zooms on pieces of an IFS-encoded right in order to capture a good
likeness of your original image.
fern. Moreover, the IFS code is
Figure 11: The collage theorem is used to encode a classical square S. The correct IFS code is obtained when the four affine
transformations of S cover S, as shown on the right.
IMAGE COMPRESSION
Assigning Probabilities filled in. Let the affine transformations W, amount of time that the randomly dancii.
corresponding to an image I be g point should spend in the subimage W,
Once you have defined your transforma- is approximately equal to
tions, you need to assign probabilities to W, [xY] - [c, d,] [xy] +
them. Different choices of probabilities do
not in general lead to different images, but
they do affect the rate at which various where i = 1, 2, 3,.. ., n. Then the continued
regions or attributes of the image are
Decoding
iteration algorithm to reconstruct an IFS-compressed image.
10 'Allow for a maximum of 4 transformations in the IFS 20 DIM
in BASIC
a(4), b(4), c(4), d(4), e(4), f(4), p(4)
isting A is a BASIC 30
implementation of the random iteration 40 'Transformation data, Sierpinski triangle 50 'First comes the
algorithm. It includes the data for the number of transformations 60 'then the coefficients a through f
and probability 70 'The values for pk should be in descending pk
Sierpinski triangle, but you can use it to
order. 80 DATA 3
process any IFS tables. In particular, you 90 DATA .5,0,0,.5,0,0,.34 100 DATA .5,0,0,.5,1,0,.33 110
will want to try the data in tables 2, 3, DATA .5,0,0,.5,.5,.5,.33
and 4. Be sure to set the variable m
correctly; it tells the program how many
transformations are in the IFS. 120
130 'Read in the data
It is also essential that the probabilities 140 READ m
in p ( ) add up to 1. For speed, the 150 pt = 0 'Cumulative probability FOR j
transformations should be listed in de- 160 = 1 TO m
scending order of probability: the highest 170 READ a(j), b(j), c(j), d(j), pt = pt + e(j), f(j), pk
probability transformation first, and the 180 pk
lowest probability last. 190 P(j) = pt
200 NEXT j
The program includes variables for
resealing and translating the origin to 210
220 'Set up for Graphics
accommodate the range of the points be-
230
ing plotted to the limits of your screen. If SCREEN 3 'Select graphics screen
240
the image is too wide, decrease xscale; if 258
the points are too close horizontally, 260 xscale = 350 'Map [0,11 onto [0,3501
increase xscale. Adjust yscale similarly to 270 yscale = 325 'Map [8,11 onto [0,3251
get a good vertical point spread. To move 280 'Initialize x and y x = 8
290 y=0
the image, adjust xoffset and yoffset. 300
You can do these adjustments by trial 310
and error: Run the program; interrupt it 320
and change the offsets and scale factors; 330 'Do 2500 iterations
and run it again. Or, you can replace the 340 FOR n = 1 TO 2580
350 pk = RND
plot command pset with a command to 'The next line works for m<=4. It must be modified 'for
print the values of x and y and run the 360
370 values of m > 4.
program to get an exact idea of the range IF pk <= p(1) THEN k = 1 ELSE IF pk <= p(2) THEN k = ELSE 2
380
of points being plotted, so you can adjust IF pk <= p(3) THEN k = 3 ELSE k = 4
the scale and offsets more precisely. 390 newx = a (k) * x + b (k) * y + e (k)
Another way to arrange the program 400 newy = c (k) * x + d (k) *
is to have it read all the data-m, a () , ( ), y+ f (k) 410 x = newx
420 y = newy
c( ), d( ), e( ), f( ), p( ) > xscale, yscale,
430 Use PRINT x,y instead of the PSET line
xoffset, and yoffset-from a disk file 440 'to see the range of coordinates. Then fix
specified by the user. Instead of reading 450 'xscale, yscale, xoffset, and yoffset
in the coefficients a, b, c, and d, you may yscale
460 IF n > 10 THEN PSET (x * xscale
want to read in angles 0 and 0 and scale + xoffset, y + yoffset)
470 NEXT n
factors r and s, and then calculate the 480
coefficients. 490 LOCATE 24, 35
The random iteration method is com- 500
putation-intensive, so we recommend use 510 PRINT "Press any key to end."; WHILE
of a compiler such as Microsoft's 520 INKEY$
530 WEND
QuickBASIC or Borland's Turbo BASIC.
540 'Return to text screen SCREEN 0
If your computer has a floatingpoint END
coprocessor and your compiler supports 550
560
one, so much the better.
IMAGE COMPRESSION
So long as ad - cd is not 0, it is a
standard calculus result that
our ratio equals the
determinant of the
transformation matrix for W,..
a; d; - b;
c;
I akdk-b,Ckl
DARPA, Atlantic Aerospace Electronics Corporation, and Iterated Systems, and it was
demonstrated on October 5, 1987, at thethirdannualmeetingoftheAppliedand Computational
Mathematics Program of DARPA. It can be connected to a personal computer through a serial
port; the personal computer sends the IFS codes to the device, whichrespondsbyproducingcom-
plex color images on a monitor.
The IFSIS is a proof of concept for faster devices with higher resolution. Once the higher-
performance IFSIS devices are combined with ISDN telecommunication, full-color animation at
video rates over phone lines will be a reality.
Another area for future application of IFS encoding is automatic image analysis. What's in a
picture? Does it show a spotted sandpiper or a robin? The more complex the image or the more
subtle the question, the harder it becomes for an algorithmic answer to be formulated. But here's
the point: Whatever the answer, it will proceed faster if stable, compressed images are used. The
reason for this is that image-recognition problems involve combinatorial searching, and searching
times increase factorially with the size of the image file.
During the spring of 1987, Iterated Systems was incorporated to develop commercial
applications of IFS image compression. It is exciting to see how an abstract field of mathematics
research is leading to new technology with implications ranging from commercial and industrial
work to personal computing. E
ACKNOWLEDGMENTS
Figures 2 through S were encoded by graduate students Francois Malassenet, Laurie Reuter, and
Arnaud Jacquin. All color images were produced in the Computergraphical Mathematics
Laboratory at Georgia Institute of Technology and are copyright 1987, GTRC.
BIBLIOGRAPHY
BYTE
Journal of Ergodic Theory and Dynamical
Systems. Forthcoming. Mandelbrot, B. The
Fractal Geometry of Nature. San Francisco,
CA: W. H. Freeman and Co., 1982.
THE SMALL SYSTEMS JOURNAL
Reprinted with permission from the January 1988 issue of BYTE magazine. Copyright c 1988
by McGraw-Hill, Inc., New York, 10020. All rights reserved.
COMPUTER
GRAPHICS
WORLD GRAPHICS
TECHNOLOGY
Chaotic Compression
A new twist on fractal theory speeds
complex image transmission to video rates
pounding the problems of takes three hours at a total
By Michael F. cost and delay, extended transmission cost of $42
Barnsley & Alan D. transmission times expose (25 cents per minute) to
data to degradation. send our sample image
Sloan 1000 miles on a 2400-bps
A one-megabyte-per-
T he massive volumes of
second Ethernet
in one second, but two
users who are
line
transmits the same image
each
toll line. The same image
can be sent to the same
address in 16 seconds at a
cost of 51 Performance
cents on a
data associated with Confounding
computer graphics exchanging one minute of Paradoxically, continuing
animation of such images improvements in computer
severely check the use of consume an hour of time.
low-bandwidth communica- graphics hardware and
Given these burdens, it's software only compound
tions devices for image easy to see"why there is the problem. Faster
transfer. Multiple users can no multiple-user network
for animating high- hardware increases the
easily overload even the resolution images at video rate of graphics production
markedly higher bandwidth rates. and thus increases demand
of local area networks. Ten thousand-to-one compression ratios can be
Potential applications go realized with a new method based on chaos theory,
fractal geometry, and affine transformations. While
unrealized as the cost of transmission can approach or exceed video rates,
transmitting graphics in- the challenge now is to reconstruct images as
creases directly with rapidly. Below: "Sunflower Field" and "Arctic Wolf,"
images compressed at 10,000:1 at Georgia Tech.
improved performance and
greater complexity. But
algorithms based on
fractal geometry can
encode image data at high
compression ratios-in
excess of 10,000 to one. It
is possible to transmit such
A Perspective on
Transmission A 1000-by-
1000-resolution computer
graphics image with eight
bits of color information
per pixel needs one
megabyte of data for
specification. The
transmission of this image
over a 2400-bit-per-second
Michael F. Barnsley and Alan D.
Sloan are professors of mathematics
at the Georgia Institute of
Technology (Atlanta). Barnsley and
Sloan are also officers of Iterated
Systems Inc. (Atlanta).
Reprinted from the November, 1987 edition of
Computer Graphics World Copyright 1987 by
PennWell Publishing Company
drives graphics software on a line between P(n) and
to produce images of Vk where Vl = A, V2 = B,
increasing complexity.
Greater image complexity and Va = C. Throw away
means more information have been working on the first 25 points and plot
that must be transmitted image compression
for each image. standards. But the com- the rest. The result is
Sophisticated printers also pression ratios being independent of the initial
increase transmission discussed are basically point P(0) as well as the
pretty low.
requirements. A new color sequence of random
For example, one exact
printer from Tektronix is a numbers which were
compression method-a
case in point. Producing an chosen in its generation.
type of method calling for
A-size, 24-bit-deep color When suitably generalized,
exact reconstruction of an
printout at 300 dpi can this process leads to full-
image-calls for a ratio of
chew up over 9M of data. color images like the
just two to one. There are
Even at the Integrated sunflowers and Arctic wolf
several exact methods,
Services Digital Network on the preceding page.
but they aren't particularly
bandwidth of 64,000 bps, Inspired by National
useful. In one experiment,
it will take over 15 Geographic photographs,
a photo montage was run-
minutes to supply the Georgia Institute of
necessary data to the An experimental device reconstructs
printer. Data compression compressed video images at the rate
and reconstruction clearly
offer the greatest potential
of about four frames per second.
for relief from the costs
associated with even the Such ratios are common to An experimental prototype
fastest communications exact compression device introduced at the
methods.
technologies. General Electric has Meeting of the Applied and
Digital data announced the Digital Computational Mathe-
compression consists of Video Interactive com- matics Program of the
encoding and decoding pression system developed Defense Advanced
phases. In the encoding at the David Sarnoff Research Projects Agency
phase, an input string of Research Center ("DVI (DARPA) in October, the
integer-based (I) bits is Video/Graphics," July, Iterated Function System
transformed into a coded p.125). As the DVI Image Synthesizer (IFSIS)
string of complex number- compression ratio in- decoded video images at
based (C) bits. The ratio of creases above 10 to one, the rate of about four
I to C bits is the compres- the loss of high-frequency frames per second.
sion ratio. In the decoding information becomes more Because of the extreme
phase, the compressed apparent. But fine detail compression ratios, this
string regenerates the isn't as critical for motion device can be coupled
original data. If the video as for still images, so loosely to any host, which
compression ratio is two to the DVI can produce a will treat it as if it were a
one, then in the time it credible video at a 100-to- printer-only it produces
would take to transmit one one ratio. complex color images
uncompressed image, two The new method described instead of text.
compressed images can here has been used to Networking and high-
be transmitted. encode complex graphics resolution, real-time
at exact compression
High-ratio image ratios of 10,000 to one. It animated graphics can be
compression slashes can be used with classical realized simultaneously by
transmission time and compression techniques to means of IFSIS-type
costs. For example, an increase yields even devices. The demon-
further-up to one million to
uncompressed minute of stration at the DARPA
drives graphics software on a line between P(n) and
to produce images of Vk where Vl = A, VZ = B,
increasing complexity.
Greater image complexity and V$ = C. Throw away
means more information have been working on the first 25 points and plot
that must be transmitted image compression
for each image. standards. But the com- the rest. The result is
Sophisticated printers also pression ratios being independent of the initial
increase transmission discussed are basically point P(0) as well as the
pretty low.
requirements. A new color sequence of random
For example, one exact
printer from Tektronix is a numbers which were
compression method-a
case in point. Producing an chosen in its generation.
type of method calling for
A-size, 24-bit-deep color When suitably generalized,
exact reconstruction of an
printout at 300 dpi can this process leads to full-
image-calls for a ratio of
chew up over 9M of data. color images like the
just two to one. There are
Even at the Integrated sunflowers and Arctic wolf
several exact methods, but
Services Digital Network on the preceding page.
they aren't particularly
bandwidth of 64,000 bps, Inspired by National
useful. In one experiment,
it will take over 15 Geographic photographs,
a photo montage was run-
minutes to supply the Georgia Institute of
necessary data to the An experimental device reconstructs
printer. Data compression compressed video images at the rate
and reconstruction clearly
offer the greatest potential
of about four frames per second.
for relief from the costs
associated with even the Such ratios are common to An experimental prototype
fastest communications exact compression device introduced at the
methods.
technologies. General Electric has Meeting of the Applied and
Digital data compression announced the Digital Computational Mathe-
consists of encoding and Video Interactive com- matics Program of the
decoding phases. In the pression system developed Defense Advanced
encoding phase, an input at the David Sarnoff Research Projects Agency
string of integer-based (I) Research Center ("DVI (DARPA) in October, the
bits is transformed into a Video/Graphics," July, Iterated Function System
coded string of complex p.125). As the DVI Image Synthesizer (IFSIS)
number-based (C) bits. compression ratio in- decoded video images at
The ratio of I to C bits is creases above 10 to one, the rate of about four
the compression ratio. In the loss of high-frequency frames per second.
the decoding phase, the information becomes more Because of the extreme
compressed string apparent. But fine detail compression ratios, this
regenerates the original isn't as critical for motion device can be coupled
data. If the compression video as for still images, so loosely to any host, which
ratio is two to one, then in the DVI can produce a will treat it as if it were a
the time it would take to credible video at a 100-to- printer-only it produces
transmit one one ratio. complex color images
uncompressed image, two The new method described instead of text.
compressed images can here has been used to Networking and high-
be transmitted. encode complex graphics resolution, real-time
at exact compression
High-ratio image ratios of 10,000 to one. It animated graphics can be
compression slashes can be used with classical realized simultaneously by
transmission time and compression techniques to means of IFSIS-type
increase yields even
costs. For example, an further-up to one million to devices. The demon-
uncompressed minute of stration at the DARPA