|
In the previous section,
we discussed three ways to get a photographic image into digital form -
film scanning, document scanning and digital camera. Now that we have
the image in the computer, how do we save, store, and recover it? We use
compression.
When a 35 mm slide is scanned into the
computer, it can have an image of 28 megabytes (9.33 megapixels). This
is a big file to store on a disk drive or send over the internet. One
might conclude that we have 28 megabytes of information, but that is not
true. We have 28 megabytes of data and maybe 2 megabytes of
information. How can this be?
In 1949, Claude Shannon, together with Warren
Weaver, published a book that contained a formula for measuring the
quantity of information in a communication. This was the first time that
someone viewed information as a measurable quantity. Looking at a
Kodachrome slide, one can now measure how much information it contains.
With that measurement, one can then determine how much computer memory
would be needed to store just that information in digital form.
Theoretically, the amount of information on a
slide is infinite, but there is a practical limit. That limit is the
amount of information needed to reproduce the slide in a form that will
be acceptable to a viewer. Weaver showed that information was dependent
upon probability and predictability. Using his theory, the amount of
information contained in a pixel is affected by what we know about the
pixels that surround it.
Enough theory!
The practical side of this is that in 1986 work
was started to establish a standard method for representing photographic
images in digital form. The group was ultimately called the "Joint
Photographic Experts Group (JPEG), under the auspices of the
International Organization for Standards (ISO), and the result is known
as the "jpeg" standard. Much of the work was done at IBM Research in
Yorktown Heights by William Pennebaker and Joan Mitchell. Files that use
that standard have the file extension .jpg or .jpeg. The conversion of a
28 megabyte "full" image into a jpeg image is called "compression."
Jpeg is not the only way to compress a
photographic image, but it is the most widely used. The method does not
deal with pixels individually, but with square sections of an image that
are 8 by 8 pixels, or 64 pixels each. The standard allows for different
levels of compression, ranging from very poor quality to very good
quality, depending upon settings used by the compression program which,
in turn, results from the users' needs and desires.
How does jpeg work? I have a 600 page book
that clearly describes it. You only need to know that the data in the 8 x
8 pixel square is represented by mathematical formulae with constants.
If a constant is calculated to be 4.3765344787, for example, it can be
"rounded" to 4.377 in one case, 4.38 in another case, and maybe just 4
in still another. As the constants are rounded, the amount of storage
required to store the information is reduced, and the file size is
reduced accordingly. Of course, 4.38 is not the same as 4.3765344787, so
some information is "lost" in the translation. What is important is
whether the difference will be noticeable to viewer. Because some
information is lost, jpeg is referred to as a "lossy" algorithm.
It is typical for a jpeg file to be one tenth
to one twentieth the size of the original uncompressed file. A 28
megabyte file can be compressed into a two megabyte file with little
noticeable difference in image quality, and one megabyte with acceptable
quality. If compressed to 100 kilobytes you would definitely notice a
difference.
|
We don't need to go into
many alternative ways of compressing an image, but some of the more
popular ones include "gif", a format patented by Compuserve, and "stn"
(Sting) images created by the Genuine Fractals program. Gif images work
best with drawings and images using spot color, like a color cartoon.
Still, very decent renderings of photographs are now available through
advances made in the gif compression methods. Sting images use another
patented approach which claims to be better when small images are to be
rendered at a larger size. You will be the judge.
Uncompressed images may have file extensions
of .tif or .tiff if they are of the "Tagged Image File Format." This
format allows for some negligible compression. It is a useful format
because it is understood by almost any photo editing program. A similar
uncompressed format used by Microsoft is .bmp, or simply, bit-map. There
may be a hundred different image formats out there, each for a
particular purpose, but those that I have mentioned cover most users'
needs.
A digital camera will usually store its
images directly in a jpeg compressed format. (Some may offer
uncompressed formats as well.) That is why a 5 megapixel image will only
take 1 megabyte of storage on your memory card. However, when you bring
that image into your computer for editing purposes, it will be
"uncompressed" into its original size. The five megapixel image which
uses 1 megabyte on your card will become a 15 megabyte file in your
computer. I know of no photo editors that can work directly with a
compressed image, although I have heard mention of their development
from time to time. Their time has passed, anyway, since memory is so
cheap that it is easy to get enough memory on a computer to handle
almost any situation.
The advantages of image compression are
obvious. You can store 600 1-megabyte (5 megapixel) images on a regular
CD. You could only store 40 uncompressed images. And the time needed to
send an image over the internet makes sending uncompressed images
virtually impossible. The methods for storing, transmitting and
retrieving images are the same as for any other kind of file. The risks
are the same. Magnetic media, such as floppies, lose their data over
time. CD's are a better choice for long term storage, as most computers
now come with CD writers. However, there will be new standards. The long
term risk is whether, in fifty years, your grandchildren will be able
to find a CD reader when they want to look at their baby pictures. Oh
well, they probably won't want to look at them anyway. But if they do,
you may be better off printing them.
All along, we have been discussing only
single "still" images. You are probably guessing by now that the same
reasoning applies to motion pictures as well. Of course you are right.
There, the standards group is called "Motion Picture Experts Group" and
their standard is called mpeg. Makes sense. Interestingly, motion
pictures can be compressed further than still images because successive
frames of a film are very similar. In addition to visual information,
motion pictures also require a soundtrack, hence the same
information-theory reasoning applies to the compression of the
soundtrack, and is called MP3 -which is an acronym created from an
acronym, with the number 3 referring to the expected level of sound
quality. It all fits together. And MP3 is now flying high in its own
right for compressing music. Just as with photos, a 20 to 1 compression
ratio is possible here as well.
Richard Ten Dyke is a member of Danbury
Area Computer Society who has had a long interest in both photography
and computers. He started his photography career with a Leica IIIC in
1952, and his computer career working with an ERA 1103 in 1956. He
currently is retired from IBM and resides in Bedford, New York. You can
reach him at Copyright 2002 Richard P. Ten Dyke
|