Digital Image Processing (Chapter 8)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

8 Image Compression

• Image Compression is the art and science of reducing


amount data required to represent an image
• Data required for two hour standard definition(SD)
television movie using 720×480×24 bits pixel arrays is
224 Gbytes
• To save storage space and reduce transmission time
• If you have 8 megapixel camera then what is the size of
one uncompressed image?
• Applications in many other areas like televideo
conferencing, remote sensing, document and
medical imaging, and Facsimile transmission(FAX)
Fundamentals
• Data compression refers to the process of reducing the
amount of data required to represent a given quantity of
information
• Data and Information are not the same thing
• Data are the means by which information is conveyed
• Various amounts of data can be used to represent the
same amount of information
• Data contains irrelevant or repeated information called
redundant data
Data Redundancy
• Data redundancy is a central issue in digital image
compression
• It is a mathematical quantifiable entity
• Denote C = b/b’ where b and b’ denote the number of bits
in two representations (data sets) of the same information
and C is commonly called the compression ratio
• Relative data redundancy of the b data set R = 1–1/C
• C = 10, for instance, means that b data set has 10 bits of
data for every 1 bit of data in the b’ data set
• Corresponding relative data redundancy of the b data
set is 0.9 indicating 90% of its data is redundant
Data Redundancies
• Types of Data Redundancies:
1. Coding Redundancy
2. Interpixel Redundancy
3. Psychovisual Redundancy
• A code is a system of symbols (letters, numbers, bits)
used to represent a body of information or set of events
• Each piece of information or event is assigned a
sequence of code symbols, called a code word
• Number of symbols in each code word is its length
• Data compression is achieved when one or more of these
redundancies are reduced or eliminated
Coding Redundancies
• If the gray levels of an image are coded in a way that
uses more code symbols than absolutely necessary to
represent each gray level, the resulting image is said to
contain coding redundancies
• Variable-length coding:
– Assigning fewer bits to the more probable gray levels than
to the less probable ones achieves data compression
• A great deal of information about the appearance of an
image could be obtained from a histogram of its gray
levels
Coding Redundancy

• pr(rk)=nk\n, k=0,1,2,…,L-1 where L is the number of gray


levels, nk is the number of times that the kth gray level
appears in the image, and n is the total number of pixels
in the image
Coding Redundancy
Interpixel Redundancy
• If the value of any given pixel can be reasonably
predicted from the value of its neighbors, the image is
said to contain interpixel redundancies
• Much of the visual contribution of a single pixel to an
image is redundant
• It could have been guessed on the basis of the values of
its neighbors
• Run-length coding
Psychovisual Redundancy
• The eye does not respond with equal sensitivity to all information
• Human perception of the information in an image normally does
not involve quantitative analysis of every pixel value in the image
• An observer searches for distinguishing features such as edges or
textural regions and mentally combines them into recognizable
groupings
• The brain then correlates these groupings with prior knowledge in
order to complete the image interpretation process
• Certain information simply has less relative importance than other
information in normal visual processing
• It can be eliminated without significantly impairing the quality of
image perception
• Lossy data compression
Image Compression Models

• Mapper: Transforms the input data into a (usually


nonvisual) format designed to reduce interpixel
redundancies in the input image
• Quantizer: Reduces the psychovisual redundancies of
the input image
Error-Free Compression
• Variable-Length Coding
– Huffman Coding
• Most popular for removing coding technique
redundancy
Huffman Coding
Arithmetic Coding
• Generates nonblock codes and it is used to remove coding
redundancy
• One to one correspondence between source symbols and
code words does not exist
• Entire sequence of source symbols is assigned a single
arithmetic code word
• The code word itself defines an interval of real numbers
between 0 and 1
• Number of symbols in the message increases, the interval
used to represent it becomes smaller and the number of
information units (say, bits) required to represent the
interval becomes larger
Arithmetic Coding
Arithmetic Coding

• The final message symbol narrows the range to [0.06752, 0.0688)


• Any number within this interval- for example, 0.068- can be used
to represent the message
LZW Coding

• Addresses spatial redundancies in an image


• The technique, called Lempel-Ziv-Welch (LZW)
coding, assigns fixed length code words to variable
length sequences of source symbols
• Probabilities are not required
• It was protected under a United States patent, LZW
compression has been integrated into a variety of
mainstream imaging file formats, including GIF, TIFF,
and PDF
• The PNG format was created to get around LZW
licensing requirements
LZW Coding
Run Length Coding
• Images with repeating intensities along their rows
(columns) can often be compressed by representing
runs of identical intensities as run-length pairs, where
each run-length pair specifies the start of a new
intensity and the number of consecutive pixels that
have that intensity
• RLE was developed in 1950s and used in FAX coding
• Effective when compressing binary images
• When there are few(or no) runs of identical pixels,
run-length encoding results in data expansion
• BMP file format uses a form of run-length
encoding
Types of File Formats
• Popular file formats are listed below:
1) GIF (Graphics Interchange Format)
2) JPEG (Joint Photographic Experts Group)
3) PNG (Portable Network Group)
4) DICOM (Digital Imaging and COMmunication)
5) SVG (Vector Graphics file format)
6) TIFF (Tagged Image File Format)
Types of File Formats
• GIF:
‒ It uses lossless compression LZW technique
‒ Quality of image is very high
‒ It supports 256 colors (8-bit)
‒ File is smaller in size
‒ It has good compression, and is good in displaying
flat color areas
‒ It also supports animation
‒ It can store multiple images and using timing
information can build animations where multiple
static images play continuously, creating the illusion
of motion
Types of File Formats
• JPEG :
– Used for storing continuous tone images
– Provides lossy and lossless compression
– Used DCT and DWT technique for compression
– Common format for storing and transmitting photographic
images on the World Wide Web
• PNG :
– Specially designed for the Web
– Supports grey scale or RGB images
– Designed for transmitting images on the Internet
– Supports transparency and interlacing
– One useful feature of PNG is its built-in text capabilities for
image indexing, allowing storage of text within the file itself
Types of File Formats
• DICOM:
‒ Popular format in medical imaging
‒ Contains image data and also metadata such as patient
details, equipment, and acquisition details
‒ Provides many communication standards
• SVG:
‒ It is a vector graphics file format that enables 2D
images to be displayed on the web
‒ Scalable to the size of the viewing window and adjust
in size and resolution according to the window in which
they are displayed
Types of File Formats
• TIFF:
‒ A flexible file format supporting a variety of image
compression standards, including JPEG, JPEG-LS,
JPEG- 2000, and others

You might also like