Raster Graphics Compression Schemes
Why compression?
-
Because graphics files can be huge
-
640 x 480 x 24 bits = approx. 1 megabyte per video
resolution image
-
30 images / second = approx. 30 megabytes per second
of motion video
-
An 8 x 10 photographic image at 300 dpi equals 2400
x 3000 pixels, or about 23 times the file size of a video image at
equivalent color depth
-
System resources (e.g. memory, disk space) and
bandwidth are finite
General compression catagories
-
Lossless vs. lossy
-
Lossless - reconstructed file will be identical
to original, uncompressed file
-
Lossy - reconstructed file will be missing some
``inessential'' data that were contained in the original, uncompressed
file
-
Avoid using lossy compression in the middle of
workflow
-
Symetrical vs. asymetrical
-
Asymetrical compression may take longer to
compress than to decompress
-
Motion video compression is an example (e.g.
MPEG)
RLE (Run Length Encoding)
-
``Runs'' of similar data values are reduced to a
single value and a description of the length of the run
-
Lossless
-
Supported in many image formats
-
Efficiency is dependent on image
-
AAAAAAAAAAAAAAA
-
15A
-
5:1 compression ratio
-
AAAAAAbbbXXXXXt
-
6A3b5X1t
-
2:1 approx. compression ratio
-
Xtmprsqzntw1fbP
-
1X1t1m1p1r1s1q1z1n1t1w111f1b1P
-
1:2 compression ratio
-
Good for most graphics, where long runs of similar
pixels may be found
-
Not so good for ``busy'' photographs
LZW (Lempel-Zev-Welch)
-
Lossless
-
Used in GIF and TIFF, among others
-
Dictionary based encoding algorithm
-
Encodes at least as well as RLE
-
Noisy images tend to reduce compression
effectiveness
JPEG (Joint Photographic Experts Group)
-
Lossy
-
Discards information not easily detected by human
eye
-
Uses luminace/chrominance schemes (YUV)
-
Human eye is more sensitive to luminance
changes,
less sensitive to color changes
-
JPEG downsamples chrominance component before
encoding
-
Advantages of JPEG
-
Supports 24 bit colorspace
-
Compression ratios of 20:1 to 25:1 without
noticeable artifacts
-
Very useful for photographs
-
Disadvantages of JPEG
-
Not very useful for many graphics
- introduces artifacts into smooth color areas
-
JPEG user strategy
-
Quality factor of 1-100
-
Higher quality means lower compression, and vice
versa
-
Start with 75
-
If no artifacts, reduce quality factor
-
If artifacts, increase quality factor
Back to color outline