IMAGE COMPRESSION
By Garima Shakya
● The objective of image compression is to reduce irrelevance and
redundancy of the image data in order to be able to store or transmit
data in an efficient form.
● Sometimes the given data contains data which has no relevant
information,or restates/repeats the known information: Data
redundancy.
Image=Information+redundant data
Need of compression...
What are the data
Redundancies used in
image compression??
Data redundancies:
There are three main data redundancies used in image compression:
● Coding redundancy: The uncompressed image usually is coded with each
pixel by a fixed length.
➔ Using some variable length code schemes such as Huffman coding and
arithmetic coding may produce compression.
● Interpixel redundancy: Spatial redundancy,it exploit the fact that an
image very often contains strongly correlated pixels, large regions whose
pixel values are the same or almost the same.
● Psychovisual redundancy: Human eye does not respond with equal
sensitivity to all incoming visual information.
➔ Some piece of information are more important than others.
➔ Removing this type of redundancy is a lossy process and the lost
information can not be recovered.
Types of compression:
Lossless:
● In lossless data compression, the integrity of the data is preserved,i.e. no
part of the data is lost in the process.
● Lossless compression methods are used when we cannot afford to lose
any data.
Lossy:
● Lossy compression can achieve a high compression ratio, since it allows
some acceptable degradation. Yet it cannot completely recover the
original data
Lossless Compression:
Two-step algorithms:
1. Transforms the original image to
some other format in which the
inter-pixel redundancy is reduced.
2. Use an entropy encoder to remove
the coding redundancy.
The lossless decompressor is a perfect
inverse process of the lossless
compressor.
Lossless
compression
● Huffman Coding
● Run-length Coding
● Arithmetic Coding
● Lempel-Ziv Coding
Lossless
compression
● Huffman Coding
● Run-length Coding
● Lempel-Ziv Coding
● Arithmetic Coding
Huffman Coding:
Huffman coding assigns shorter codes to symbols that occur more frequently
and longer codes to those that occur less frequently.
For example,
Character A B C D E
Frequency 17 12 12 27 32
Lossless
compression
● Huffman Coding
● Run-length Coding
● Arithmetic Coding
● Lempel-Ziv Coding
Run-Length Coding
● It can be used to compress data made of any combination of symbols.
● It does not need to know the frequency of occurrence of symbols.
● The method is to replace consecutive repeating occurrences of a symbol
by one occurrence of the symbol followed by the number of occurrences.
The method can be even more efficient if the data uses only two symbols (for
example 0 and 1) in its bit pattern and one symbol is more frequent than the
other.
Lossless
compression
● Huffman Coding
● Run-length Coding
● Arithmetic Coding
● Lempel-Ziv Coding
Arithmetic Coding
A sequence of source symbols is assigned to a sub-interval in [0,1) which can
be represented by an arithmetic code.
For example, message: a1a2 a3 a3 a4
1) Start with interval [0, 1) :
Source symbol Probability
a1 0.2
a2 0.2
a3 0.4
a4 0.2
0 1
2) Subdivide [0, 1) based on the probabilities of
symbols:
Source Symbol Probability Initial Subinterval
a1 0.2 [0.0, 0.2)
a2 0.2 [0.2, 0.4)
a3 0.4 [0.4, 0.8)
a4 0.2 [0.8, 1.0)
0 1
0.2 0.2 0.4 0.2
Initial Subinterval
[0.0,0.2)
[0.2,0.4)
[0.4,0.8)
[0.8,1.0)
[0.06752, 0.0688)
or 0.068
Encode a1 a2 a3 a3 a4
(must be inside sub-interval)
Lossless
compression
● Huffman Coding
● Run-length Coding
● Arithmetic Coding
● Lempel-Ziv Coding
Lempel-Ziv Coding
● It is an example of a category of algorithms called dictionary-based
encoding .
● The idea is to create a dictionary (a table) of strings used during the
communication session.
● If both the sender and the receiver have a copy of the dictionary, then
previously-encountered strings can be substituted by their index in the
dictionary to reduce the amount of information transmitted.
Compression:
Decompression:
References:
● https://en.wikipedia.org/wiki/Data_compression
● https://en.wikipedia.org/wiki/Lossless_compression
● https://en.wikipedia.org/wiki/lossy_compression
Thank You!

Image compression

  • 1.
  • 2.
    ● The objectiveof image compression is to reduce irrelevance and redundancy of the image data in order to be able to store or transmit data in an efficient form. ● Sometimes the given data contains data which has no relevant information,or restates/repeats the known information: Data redundancy. Image=Information+redundant data Need of compression...
  • 3.
    What are thedata Redundancies used in image compression??
  • 4.
    Data redundancies: There arethree main data redundancies used in image compression: ● Coding redundancy: The uncompressed image usually is coded with each pixel by a fixed length. ➔ Using some variable length code schemes such as Huffman coding and arithmetic coding may produce compression. ● Interpixel redundancy: Spatial redundancy,it exploit the fact that an image very often contains strongly correlated pixels, large regions whose pixel values are the same or almost the same.
  • 5.
    ● Psychovisual redundancy:Human eye does not respond with equal sensitivity to all incoming visual information. ➔ Some piece of information are more important than others. ➔ Removing this type of redundancy is a lossy process and the lost information can not be recovered.
  • 6.
    Types of compression: Lossless: ●In lossless data compression, the integrity of the data is preserved,i.e. no part of the data is lost in the process. ● Lossless compression methods are used when we cannot afford to lose any data. Lossy: ● Lossy compression can achieve a high compression ratio, since it allows some acceptable degradation. Yet it cannot completely recover the original data
  • 7.
    Lossless Compression: Two-step algorithms: 1.Transforms the original image to some other format in which the inter-pixel redundancy is reduced. 2. Use an entropy encoder to remove the coding redundancy. The lossless decompressor is a perfect inverse process of the lossless compressor.
  • 8.
    Lossless compression ● Huffman Coding ●Run-length Coding ● Arithmetic Coding ● Lempel-Ziv Coding
  • 9.
    Lossless compression ● Huffman Coding ●Run-length Coding ● Lempel-Ziv Coding ● Arithmetic Coding
  • 10.
    Huffman Coding: Huffman codingassigns shorter codes to symbols that occur more frequently and longer codes to those that occur less frequently. For example, Character A B C D E Frequency 17 12 12 27 32
  • 14.
    Lossless compression ● Huffman Coding ●Run-length Coding ● Arithmetic Coding ● Lempel-Ziv Coding
  • 15.
    Run-Length Coding ● Itcan be used to compress data made of any combination of symbols. ● It does not need to know the frequency of occurrence of symbols. ● The method is to replace consecutive repeating occurrences of a symbol by one occurrence of the symbol followed by the number of occurrences.
  • 16.
    The method canbe even more efficient if the data uses only two symbols (for example 0 and 1) in its bit pattern and one symbol is more frequent than the other.
  • 17.
    Lossless compression ● Huffman Coding ●Run-length Coding ● Arithmetic Coding ● Lempel-Ziv Coding
  • 18.
    Arithmetic Coding A sequenceof source symbols is assigned to a sub-interval in [0,1) which can be represented by an arithmetic code. For example, message: a1a2 a3 a3 a4 1) Start with interval [0, 1) : Source symbol Probability a1 0.2 a2 0.2 a3 0.4 a4 0.2 0 1
  • 19.
    2) Subdivide [0,1) based on the probabilities of symbols: Source Symbol Probability Initial Subinterval a1 0.2 [0.0, 0.2) a2 0.2 [0.2, 0.4) a3 0.4 [0.4, 0.8) a4 0.2 [0.8, 1.0) 0 1 0.2 0.2 0.4 0.2 Initial Subinterval [0.0,0.2) [0.2,0.4) [0.4,0.8) [0.8,1.0)
  • 20.
    [0.06752, 0.0688) or 0.068 Encodea1 a2 a3 a3 a4 (must be inside sub-interval)
  • 21.
    Lossless compression ● Huffman Coding ●Run-length Coding ● Arithmetic Coding ● Lempel-Ziv Coding
  • 22.
    Lempel-Ziv Coding ● Itis an example of a category of algorithms called dictionary-based encoding . ● The idea is to create a dictionary (a table) of strings used during the communication session. ● If both the sender and the receiver have a copy of the dictionary, then previously-encountered strings can be substituted by their index in the dictionary to reduce the amount of information transmitted.
  • 23.
  • 24.
  • 25.
  • 26.