Let’s Get Technical
330 KB of storage was
converted into a 220 KB
MP3 file. The MP3 file
sounds as good as — if
not better than — the
original WAV file, with
the absence of 110 KB of
sound information.
Even sampling the
analog sound information can be approached
from different directions. Using an analog-to-digital converter, you
may sample the
converter 8,000 times
per second, reading an
eight-bit sample each time. Thus, a
one second audio waveform would
require 64,000 bits of storage.
Now, suppose you change the
sampling hardware to one that uses
a delta modulation method, where
the sample can only increase or
decrease by a small value each
time. (This is the delta.) Then, each
sample only requires one bit of
storage.
Now, one second of audio only
requires 8,000 bits of information.
If the delta modulation method
does not have significant slope
overload losses (signal level changing faster than one delta between
samples), it provides a nice, built-in
compression over the eight-bit A/D
method.
Once the MP3 compressor has
thrown away the WAV file’s
redundant and unnecessary signal
information, there is no way to get it
back. In this case, it does not matter,
since the MP3 format has high
quality.
What if we need to have every bit
of the original data back when it is
Graphics Interchange
Format. JPEG stands for
Joint Photographic Experts
Group. GIF files were created by CompuServe as a
method of exchanging
graphical information. The
features of a .GIF file are
as follows:
• Maximum of 256
simultaneous colors
Figure 2. Sample image containing 24,320 pixels.
• Lossless compression
using LZW (
Lempel-Ziv-Welch) algorithm
uncompressed? If we compress a
program file and then uncompress
it, every byte in the file has to be
correct or the program will not
function correctly when the
program is executed.
In this case, we need a compression algorithm that is
“lossless.” The technique used to
convert the WAV file to an MP3 file
is a “lossy” compression technique,
since some of the original data is
thrown away.
Okay, so the MP3 audio file is
one place where lossy compression
may be used to advantage, but
where else can we get away with it?
We cannot do so in program files,
for sure, or even files that contain
important information, such as
databases, but what about image
files?
Browsing the Internet is a widespread activity, awash with images of
many shapes and sizes. Web
browsers that display graphical
images accept two different types of
image files: GIF images and JPG (or
JPEG) images. GIF stands for
• Support for animation and
transparency built-in
• Interlaced and non-interlaced
formats
The quality of the GIF image was
kept low so that its file size could be
managed. People with dial-up
modems for their Internet
connection do not want to wait
forever for an image to load.
When the GIF image data is
decompressed for display purposes,
an exact copy of the original data is
reproduced, due to the lossless
compression used on the original
image data.
Compare the properties available in GIF encoding with those
of JPG:
• 24-bit color ( 16,777,216 simultaneous colors with eight bits each
for red, green, and blue)
• Lossy compression using the
DCT (Discrete Cosine Transform)
algorithm on eight-by-eight blocks
of pixels
F
o
r
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
E
v
e
r
y
t
h
i
n
g
Property
GIF Image
JPG Image
Bits / Pixel
8
24
• No animation or transparency
available
Colors Used
256
20,089
Max Colors
256
16,777,216
• Non-interlaced format only
File Size
24,557 bytes
10,097 bytes
Table 2. Comparison of the same image saved as a GIF and a JPG.
24
JPG files are preferred over GIF
files for their photographic-quality
color. In addition, the lossy JPG
SEPTEMBER 2004