Você está na página 1de 7

University Name JNTU

Semester Year 4 Sem 7


Subject Name Digital Image Processing
Subject Code U5_T8
Topic Name Lossy Compression

Short Name Lossy Compression

SME Name K.S.THIVYA


ID Name

Clearly defined Explain data compression


objectives Discuss Lossy Compression
A short Before heading in to the topic, first let us see what is data compression?
Data Compression is the process of reducing the amount of data
introduction to required to represent a given quantity of information. Data and Information are
the lesson that not the same.
should include a – Data
context • means by which information is conveyed
• various amounts of data can convey the same
statement, an information
analogy, and – Information
importance of • “A signal that contains no uncertainty”
the new lesson. Lossy
• Original data is approximated
• Less than perfect
• Generally allows much higher compression

• Unlike the error-free compression, lossy encoding is based on the concept of


compromising the accuracy of the reconstructed image in exchange for increased
compression.
•The lossy compression method produces distortion which is irreversible. On the
other hand, very high compression ratios ranging between 10:1 to 50:1 can be
achieved with visually indistinguishable from the original. The error-free methods
rarely give results more than 3:1.

Application:

An example of lossy data compression is the JPEG standard for storing


pictures. The reason this standard is called "lossy" is because a picture can be
saved into smaller and smaller files on each occasion that results in image
An application degrading with the structure still visible but the details getting lost. This means
that when the file is recreated it is not identical to the original.
that explains How does this happen? It is done by making similar types of pattern identical. The
where the more aggressive the rules for making patterns similar then the smaller the file, but
concept is the larger the differences.
implemented. The JPEG standards and other standards are mathematically complex but use
underlying basic principles. These principles can be understood by looking at how
a text file would appear if logically similar techniques to lossy file compression are
applied to it.

The main Lossy Repeating Patterns Rules


content can be
in the form of
The key difference between Lossless and Lossy file compression is that in Lossy the
Procedure, exact sequence is not retained, there by near enough is used instead. For a
Process, computer this is done by applying rules in a similar manner to the two Lossless
Principle, Fact or techniques. In fact Lossy techniques will retain exact patterns where possible.
concept The rules used for the Lossy technique are similar but different from the Complex
Lossless.
1. Start by finding the largest sequence of characters that nearly repeats at
least once using these guidelines:
o Ignore capitalisation when comparing strings.

o Ignore changes in punctuation.

o Ignore additional spaces.

o Allow up to one character difference between sequences.

2. Compare smaller sequences with larger ones to see if the larger one can
be split following the same guidelines.

3. Choose the most common sequence as the substitute for all the similar
sequences.

4. Look at smaller sequences until you reach three character sequences. (as
before)

5. Only accept a sequence if it will result in an at least two character


reduction in file size.

To make the fifth rule to be viable, there must be 3 repetitions of a 3 or 4 character


sequence. For all greater sequence sizes 2 repetitions are enough.
The "We Shall Fight" Sequences
Applying the new rules to the example text (see Simple Lossless) for the phrase
"we shall fight" results in some considerable savings. These are the repetitions of
the phrase:
Following the rules shows that first we find in three examples of the long sequence
",_we_shall_fight_on_the_". The next long sequence is two examples of
",_we_shall_fight_in_the_". Comparing the phrases shows they are similar with
only one character difference. Therefore the first example will be the one used for
all five instances.
The third phrase is ",_we_shall_fight_in_". The common factor of
",_we_shall_fight_" can be included in the previous entry the three characters of
"in_" put back into the main text and the main phrase split.
The savings would be the 17 characters in the ",_we_shall_fight_" sequence. The
cost would be a new tag for the phrase and a new dictionary entry for "on_the_"
of 7 characters plus 1 for the code and 5 tags in the text making a total of 14
characters. This shows it is worthwhile as overall 3 characters are saved which is
above the target of at least 2.
The fourth phrase is ",_we_shall_fight_" just requires a tag in the text.
The fifth phrase is ",_we_shall_" consisting of 11 characters. The phrase
",_we_shall_fight_" can be split into two. If so it will require 1 character for the
code for "fight_" and 8 characters for new tags in the text. This is a saving of 2
characters and is accepted.
The sixth phrase is ";_we_shall_" consisting of 11 characters with different
punctuation. Following the rule the punctuation is set to the common version of a
comma and is substituted.
Lastly the seventh variation "We_shall_" is included in the common sequence by
ignoring the capital letter and including a space and a comma.
As a result of this process we have three phrases to include in the dictionary:
",_we_shall_", "fight_", and "on_the_".

We can now check for other phrases and the following sequences for
consideration show up.
Checking the rest of the sequences shows that "_growing_" and "ever_" remain.
The sequence "end" remains as it has 3 entries whereas "nce" is removed as it
only has 2 entries.
The sequences "_in_the_" and "on_the_" from the "we shall fight" reduction can
be combined as 7 entries of "on_the_" resulting in a saving of 7 characters.
The sequence "the_" forms part of the sequence "on_the_". The "on_the_"
sequence would save 4 characters in the dictionary but require 7 new code tags.
As a result the "the_" sequence is removed.
This leaves the 2 entries of "_and_", 1 entry of "_and" and 2 entries of "and".
These are combined into the most common form.
The differences are highlighted in the text and are:
 In line 1 the start of the sentence has a space and comma before it and is not
capitalised.
 In Line 4 there is an extra space between "and" and "growing".

 In line 4, 8 and 9 the four instances of "in" have been changed to "on".

 In line 5 there is a space in and after "Island".

 In line 7 there are two spaces in "landing".

It is still recognisable as the original text. In many cases people would not spot the
difference as many believe the key line is one of:
 "we shall fight them on the beaches"
 "we will fight on the beaches"

 "we will fight them on the beaches".

All of which are wrong but have the same feel to them.

Compression Achieved:

The file that is output after compression consists of the reduced file with the tags
inserted plus the dictionary of phrases and the codes that now represent them.
The figures shown in brackets are the equivalents for the Complex Lossless
compression.
The original file consisted of 391 characters of which 255 (233) have been taken
out leaving 136 (158) characters. This is 26 characters more than the Simple
Lossless compression. To mark the phrase positions 36 (35) tags have been
inserted which means the file is 172 (193) characters long. Thus this approach has
resulted in a smaller file of 21 characters.
The dictionary is also smaller. It has 7 (8) entries and 46 (50) characters for the
phrases giving a total for the dictionary of 53 (58) characters. This is due to the
consolidation of similar entries in the dictionary.
Therefore the whole file is 225 (251) characters long. Compared with the original
file of 391 characters this is compression of 58% (64%) of the original size.
Website and http://www.coleyconsulting.co.uk/lossy_compression_pt2.htm
Book references http://www.coleyconsulting.co.uk/lossy_compression_pt1.htm
https://cs.stanford.edu/people/eroberts/courses/soco/projects/data-
compression/lossy/index.htm
https://www.slideshare.net/OmarGhaziAbood/presentation-of-lossy-
compression
digital image processing- jayaram

Ensure that the below checklist is adhered for e-learning quality


and suitability.

 Are objectives stated clearly for the learner and do they include
the conditions and criteria for the evaluation?

 Do the chapters/videos thoroughly cover the lesson objectives?


 Does the content flow seamlessly?
 Is the content up-to-date?
 Is the content aligned with the curriculum?
 Is the content in compliance with copyright laws and all its
quoted material cited correctly

Comments :
Objectives are correctly stated and the concepts of JPEG is also explained .
The flow is also good and aligned with curriculum. Proceed for creating SB.

Remember the concept and applications of lossy and lossless compression


stated below.

The lossless compression each and every bits are preserved after
decompression of the image. The original image is achieved with medium
compression ratio. So lossless image is used in medical applications. The
Quantization involved in this linear and reversible. Example for lossless
compression is .gif (Graphics interchange Formats) files

In lossy compression all the bits are not preserved, the redundancy bits are
removed and the original image is not obtained after decompression. The
compression ratio achieved is very high. The main application of lossy
compression is multimedia applications. Image Quantization involves non
linear and irreversible. Example for lossy compression is .jpg files

Você também pode gostar