2. IMAGE COMPRESSION
The process of coding that will reduce the total number of bits
needed to represent certain information.
Objective of image compression is to reduce irrelevance and
redundancy of the image.
In other words we can say that it is the compression of graphics
for storage or transmission, so that the image can be stored or
transmitted in an efficient form.
5. WHY IMAGE COMPRESSION?
Image compression techniques are of prime importance for
reducing the amount of information needed for the picture
without losing much of its quality.
To reduce the size of stored or transmitted files to manageable
sizes, or to reduce the time it would take to transmit these files to
another computer.
To reduce the real-time bandwidth required to transmit time-
sensitive video data across a communication link.
6. NEED FOR IMAGE COMPRESSION
An image, 1024 pixel x 1024 pixel x 24 bit, without compression,
would require 3 MB of storage and 7 minutes for transmission.
If the image is compressed at a 10:1 compression ratio, the
storage requirement is reduced to 300 KB and the transmission
time drops to under 6 seconds.
Compression is an important component of the solutions
available for creating file sizes of manageable and
transmittable dimensions.
7. CONTI…
Increasing the bandwidth is another method, but the cost
sometimes makes this a less attractive solution.
8. TYPES IMAGE COMPRESSION
Image compression can be performed by two ways:-
Lossy Compression
Lossless Compression
Lossless Compression the data is compressed without any loss
of data.
Lossy Compression it is assumed that some loss of information
is acceptable. Is suitable for natural image.
9. LOSSLESS COMPRESSION
With lossless compression, data is compressed without any
loss of data.
It assumes you want to get everything back that you put in i.e., we
can reconstruct a perfect reproduction of the original from the
compression.
Critical financial data files are examples where lossless
compression is required.
10. CONTI…
Lossless compression ratios usually only achieve a 2:1
compression ratio.
Useful for text, numerical data, use of scanners to locate details in
images, etc. where there is a precise meaning for the data.
Even for images or other perceived signals, lossless
compression is sometimes required, particularly for legal
documents, medical images,
11. TYPES OF LOSSLESS COMPRESSION
Lossless coding techniques types are:-
Run length encoding:- Very simple form of data compression in
which runs of data are stored as a single data value and count,
rather than as the original run.
Huffman encoding:-This is a general technique for coding
symbols based on their statistical occurrence frequencies
(probabilities).
The pixels in the image are treated as symbols. The symbols that
occur more frequently are assigned a smaller number of bits, while
the symbols that occur less frequently are assigned a relatively
larger number of bits.
12. CONTI…
Dictionary Codes:- Dictionary based data compression
algorithms are based on the idea of substituting a repeated pattern
with a shorter token.
Dictionary codes are compression codes that dynamically
construct their own coding and decoding tables “on the fly” by
looking at the data stream itself
13. LOSSY COMPRESSION
With lossy compression, it is assumed that some loss of
information is acceptable.
When we reconstruct the information from the compressed
data, we get something close to but not exactly the same as the
original.
Lossy compression can provide compression ratios of 100:1 to
200:1, depending on the type of information being compressed.
14. CONTI…
Lossy compression techniques are often "tunable" in that you can
turn the compression up to improve throughput, but at a loss in
quality.
Lossy compression is very useful for images, audio signals, or
other information that is perceived through our senses.
15. TYPES OF LOSSY COMPRESSION
There are three major types of lossy data compression technique:-
Lossy transform code:-The lossy transform codec's compression
is generally used for JPEG images only. In this case samples of the
picture is taken, they are then choped into smaller segments and
then transformed into a new image.
Lossy predictive code:-In predictive codec's, previous and/or
subsequent decoded data is used to predict the compressed image
frame
16. CONTI…
Chroma sub sampling:-It’s commonly used in video encoding
schemes and in JPEG images. It drops or make an average of
some chroma (colour) information while maintaining luma
(brightness) information.
18. RUN LENGTH ENCODING
Is a very simple form of data compression in which, runs of data
are stored as a single data value and count, rather than as the
original run.
This is most useful on data that contains many such runs: for
example, simple graphic images such as icons, line drawings, and
animations.
Does not assume a memory less source.
19. CONTI…
Example Of RUN LENGTH ENCODING :-
For example, consider a screen containing plain black text on a
solid white background. There will be many long runs of white
pixels in the blank space, and many short runs of black pixels
within the text. Let us take a hypothetical single scan line, with B
representing a black pixel and W representing white:
WWWWWWWWWWWWBWWWWWWWBBBWWWWWB
If we apply the run-length encoding (RLE) data compression
algorithm to the above hypothetical scan line, we get:
12W1B8W3B5W1B
This is to be interpreted as twelve Ws, one B, eight Ws, three Bs, five
Ws and one B.
20. CONTI..
The run-length code represents the original 29 characters in only
13.
RLE schemes are simple and fast, but their compression efficiency
depends on the type of image data being encoded.
21. ADVANTAGES OF RLE
Very useful in case of repetitive data
Easy storage and retrieval of image
Environmental friendly
22. DISADVANTAGES OF RLE
The minimum useful run-length size is increased from three
characters to four. This could affect compression efficiency with
some types of data.
High initial cost
Need for standardization
23. ALGORITHM FOR RUN LENGTH ENCODING
Step 1. Set the previous symbol equal to an unmatchable value.
Step 2. Read the next symbol from the input stream.
Step 3. If the symbol is an EOF exit.
Step 4. Write out the current symbol.
Step 5. If the symbol is an does not match the previous symbol,
set the previous symbol to the current symbol, and go to step 2.
Step 6. Read and count additional symbols until a non-matching
symbol is found. This is the run length.
24. CONTI…
Step 7. Write out the run length.
Step 8. Write out the non-matching symbol.
Step 9. Set the previous symbol to the non-matching symbol, and
go to step 2.
25. APPLICATION
Run-length encoding performs lossless data compression and is
well suited to palette-based bitmapped images such as computer
icons.
Run-length encoding is used in fax machines (combined with
other techniques into Modified Huffman coding). It is relatively
efficient because most faxed documents are mostly white space,
with occasional interruptions of black.
26. ADVANTAGES OF IMAGE COMPRESSION
Less disk space (more data in reality).
Faster writing and reading.
Faster file transfer.
Variable dynamic range.
Byte order independent.
27. DISADVANTAGES OF IMAGE COMPRESSION
Added complication.
Effect of errors in transmission.
Slower for sophisticated methods (but simple methods can be
faster for writing to disk).
Need to decompress all previous data.