SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
LZW CODING TECHNIQUE FOR IMAGE COMPRESSIONLZW CODING TECHNIQUE FOR IMAGE COMPRESSION
RAHUL PATHAK RENJITH R
CB.EN.P2AEL15018
CB.EN.P2AEL15020
CONTENTSCONTENTS
An overview of Image compression
Techniques for Image compression
An Introduction to LZW coding technique
Methodology (Algorithm) LZW coding
Advantages and Disadvantages of LZW coding
Applications of LZW coding
An overview of Image compressionAn overview of Image compression
 Goals of compression
a) Remove redundancy
b) Reduce irrelevance
c) Reduce storage required and hence the cost
d) Reduced bandwidth can be used
e) Reduces time to retrieve and transmit data
 Compression modes
1) Lossless compression
Preserve all information, perfectly recoverable.
2) Lossy compression
Throw away perceptually insignificant information
and cannot recover all bits
An overview of Image compressionAn overview of Image compression
 Compressed data = compress (original Data)
 Decompressed data = decompress(Compressed data)
 When original Data = decompressed data, the compression is
lossless.
 When original data != decompressed data, the compression is
lossy.
 Lossless compression is essential in applications such as text file
compression/ Medical imaging applications
 In video transmission, a slight loss in the transmitted video is not
noticed by the human eye.
 Compression ratio = original data size/compressed data size
Techniques for Image compressionTechniques for Image compression
?
An Introduction to LZW coding techniqueAn Introduction to LZW coding technique
 Lempel-Ziv-Welch (LZW) coding is the foremost technique
for general purpose data compression due to its simplicity
and versatility.
 It is invented by Abraham Lempel, Jacob Ziv, and Terry Welch
 It addresses spatial redundancies in an image
 It is an error free compression approach
 Prior knowledge of probability of occurrence of symbols to
be encoded is not required.
 Lossless compression technique
Why LZW coding?Why LZW coding?
 For most palette color images LZW yields the highest
compression efficiency without sacrificing image
data. 
 The GIF image file format is the de facto standard for
images on the web. Most GIF files use the LZW
compression.
AN EXAMPLEAN EXAMPLE
 Consider an image of size 512*512, 8 bit image.
Uncompressed TIFF Version of this image requires
286,740 bytes of disk space
 Using TIFF's LZW compression option,however,the
resulting file is 224,420 bytes.
 The compression ratio ,C= (286740 / 224420)= 1.277
 For Huffman encoded representation of the same
image achieves compression ratio, C=1.077.
 The additional compression realized by LZW approach is
due to removal of Image's spatial redundancy.
Basic Principles of LZW CodingBasic Principles of LZW Coding
 LZW coding assigns fixed length code words to variable length
sequence of input symbols.
 The coding is based on a “dictionary” or “codebook” containing the
source symbols to be encoded. The coding starts with an initial
dictionary, which is enlarged with the arrival of new symbol
sequences.
Encoding a sequence of symbols using LZW CodingEncoding a sequence of symbols using LZW Coding
 The encoding process is be illustrated for one line of image
having the following intensity values in sequence: 32 32 34
32 34 32 32 33 32 32 32 34.
 Consider the table as below:
Sequence:Sequence: 32 32 34 32 34 32 32 33 32 32 32 34.32 32 34 32 34 32 32 33 32 32 32 34.
Decoding a Lempel-Ziv encoded sequenceDecoding a Lempel-Ziv encoded sequence
Table 27-3 provides the step-by-step details for
an example input file consisting of 45 bytes, the
ASCII text
string: the/rain/in/Spain/falls/mainly/on/the/plain.
When we say that the LZW algorithm reads
the character "a" from the input file, we mean it
reads the value: 01100001 (97 expressed in 8
bits), where 97 is "a" in ASCII. When we say it
writes the character "a" to the encoded file, we
mean it writes: 000001100001 (97 expressed in
12 bits).
Advantages and disadvantages of LZW codingAdvantages and disadvantages of LZW coding
Advantages:
 Extremely effective when there are repeated patterns
in the data that are widely spread
 Prior knowledge of probability of occurrence of symbols
to be encoded is not required.
 Simple coding technique with high compression ratio.
 LZW compression is fast
 Lossless compression technique
Disadvantages:
 Creates entries in the dictionary that may never be
used.
 LZW is a fairly old compression technique
Applications of LZW codingApplications of LZW coding
LZW compression can be used in a variety of file formats:
 TIFF (tagged image file format )files
 GIF (graphic interchange format ) files
 PDF(portable document format) files
 Unix Compress, gzip.
 Suitable for compressing text files

Contenu connexe

Tendances

Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantizationBCET, Balasore
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compressionasodariyabhavesh
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image CompressionMathankumar S
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domainAshish Kumar
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standardanuragjagetiya
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compressionjeevithaelangovan
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & DescriptorsPundrikPatel
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 

Tendances (20)

image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Image sampling and quantization
Image sampling and quantizationImage sampling and quantization
Image sampling and quantization
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standard
 
Subband Coding
Subband CodingSubband Coding
Subband Coding
 
Wavelet transform in image compression
Wavelet transform in image compressionWavelet transform in image compression
Wavelet transform in image compression
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
 
Image Representation & Descriptors
Image Representation & DescriptorsImage Representation & Descriptors
Image Representation & Descriptors
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Edge detection
Edge detectionEdge detection
Edge detection
 

Similaire à Lzw coding technique for image compression

Data compretion
Data compretionData compretion
Data compretionSajan Sahu
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...Helan4
 
Data compression
Data compressionData compression
Data compressionNizar Sbaih
 
Data representation
Data representationData representation
Data representationChingTing
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxMedinaBedru
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data CompressionPratik Pradhan
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introductionsangusajjan
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithmijistjournal
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithmijistjournal
 
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...ijsrd.com
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.pptHarisMasood20
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmchezhiyan chezhiyan
 

Similaire à Lzw coding technique for image compression (20)

Data compretion
Data compretionData compretion
Data compretion
 
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
2.3 unit-ii-text-compression-a-outline-compression-techniques-run-length-codi...
 
Data compression
Data compressionData compression
Data compression
 
Data representation
Data representationData representation
Data representation
 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptx
 
Chap54
Chap54Chap54
Chap54
 
Source coding
Source codingSource coding
Source coding
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
 
Compressionbasics
CompressionbasicsCompressionbasics
Compressionbasics
 
Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...Introduction Data Compression/ Data compression, modelling and coding,Image C...
Introduction Data Compression/ Data compression, modelling and coding,Image C...
 
VII Compression Introduction
VII Compression IntroductionVII Compression Introduction
VII Compression Introduction
 
11. lzw coding
11. lzw coding11. lzw coding
11. lzw coding
 
Image compression
Image compression Image compression
Image compression
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithm
 
Design and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression AlgorithmDesign and Implementation of LZW Data Compression Algorithm
Design and Implementation of LZW Data Compression Algorithm
 
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...
Image Compression Using Intra Prediction of H.264/AVC and Implement of Hiding...
 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
 
Presentation on Image Compression
Presentation on Image Compression Presentation on Image Compression
Presentation on Image Compression
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithm
 

Dernier

Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Bahzad5
 
Phase noise transfer functions.pptx
Phase noise transfer      functions.pptxPhase noise transfer      functions.pptx
Phase noise transfer functions.pptxSaiGouthamSunkara
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfodunowoeminence2019
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Sean Meyn
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...soginsider
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxSAJITHABANUS
 
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxSUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxNaveenVerma126
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingMarian Marinov
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptxMUKULKUMAR210
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabusViolet Violet
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfNaveenVerma126
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesDIPIKA83
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvementVijayMuni2
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxrealme6igamerr
 
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...Amil baba
 
Multicomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfMulticomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfGiovanaGhasary1
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfJulia Kaye
 

Dernier (20)

Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)Lecture 1: Basics of trigonometry (surveying)
Lecture 1: Basics of trigonometry (surveying)
 
Phase noise transfer functions.pptx
Phase noise transfer      functions.pptxPhase noise transfer      functions.pptx
Phase noise transfer functions.pptx
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
 
Présentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdfPrésentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdf
 
Lecture 4 .pdf
Lecture 4                              .pdfLecture 4                              .pdf
Lecture 4 .pdf
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
 
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptxIT3401-WEB ESSENTIALS PRESENTATIONS.pptx
IT3401-WEB ESSENTIALS PRESENTATIONS.pptx
 
計劃趕得上變化
計劃趕得上變化計劃趕得上變化
計劃趕得上變化
 
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docxSUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
SUMMER TRAINING REPORT ON BUILDING CONSTRUCTION.docx
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptx
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabus
 
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdfSummer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
Summer training report on BUILDING CONSTRUCTION for DIPLOMA Students.pdf
 
Graphics Primitives and CG Display Devices
Graphics Primitives and CG Display DevicesGraphics Primitives and CG Display Devices
Graphics Primitives and CG Display Devices
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvement
 
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptxUNIT4_ESD_wfffffggggggggggggith_ARM.pptx
UNIT4_ESD_wfffffggggggggggggith_ARM.pptx
 
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...
Best-NO1 Best Rohani Amil In Lahore Kala Ilam In Lahore Kala Jadu Amil In Lah...
 
Multicomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdfMulticomponent Spiral Wound Membrane Separation Model.pdf
Multicomponent Spiral Wound Membrane Separation Model.pdf
 
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdfsdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
sdfsadopkjpiosufoiasdoifjasldkjfl a asldkjflaskdjflkjsdsdf
 

Lzw coding technique for image compression

  • 1. LZW CODING TECHNIQUE FOR IMAGE COMPRESSIONLZW CODING TECHNIQUE FOR IMAGE COMPRESSION RAHUL PATHAK RENJITH R CB.EN.P2AEL15018 CB.EN.P2AEL15020
  • 2. CONTENTSCONTENTS An overview of Image compression Techniques for Image compression An Introduction to LZW coding technique Methodology (Algorithm) LZW coding Advantages and Disadvantages of LZW coding Applications of LZW coding
  • 3. An overview of Image compressionAn overview of Image compression  Goals of compression a) Remove redundancy b) Reduce irrelevance c) Reduce storage required and hence the cost d) Reduced bandwidth can be used e) Reduces time to retrieve and transmit data  Compression modes 1) Lossless compression Preserve all information, perfectly recoverable. 2) Lossy compression Throw away perceptually insignificant information and cannot recover all bits
  • 4. An overview of Image compressionAn overview of Image compression  Compressed data = compress (original Data)  Decompressed data = decompress(Compressed data)  When original Data = decompressed data, the compression is lossless.  When original data != decompressed data, the compression is lossy.  Lossless compression is essential in applications such as text file compression/ Medical imaging applications  In video transmission, a slight loss in the transmitted video is not noticed by the human eye.  Compression ratio = original data size/compressed data size
  • 5. Techniques for Image compressionTechniques for Image compression ?
  • 6. An Introduction to LZW coding techniqueAn Introduction to LZW coding technique  Lempel-Ziv-Welch (LZW) coding is the foremost technique for general purpose data compression due to its simplicity and versatility.  It is invented by Abraham Lempel, Jacob Ziv, and Terry Welch  It addresses spatial redundancies in an image  It is an error free compression approach  Prior knowledge of probability of occurrence of symbols to be encoded is not required.  Lossless compression technique
  • 7. Why LZW coding?Why LZW coding?  For most palette color images LZW yields the highest compression efficiency without sacrificing image data.   The GIF image file format is the de facto standard for images on the web. Most GIF files use the LZW compression.
  • 8. AN EXAMPLEAN EXAMPLE  Consider an image of size 512*512, 8 bit image. Uncompressed TIFF Version of this image requires 286,740 bytes of disk space  Using TIFF's LZW compression option,however,the resulting file is 224,420 bytes.  The compression ratio ,C= (286740 / 224420)= 1.277  For Huffman encoded representation of the same image achieves compression ratio, C=1.077.  The additional compression realized by LZW approach is due to removal of Image's spatial redundancy.
  • 9. Basic Principles of LZW CodingBasic Principles of LZW Coding  LZW coding assigns fixed length code words to variable length sequence of input symbols.  The coding is based on a “dictionary” or “codebook” containing the source symbols to be encoded. The coding starts with an initial dictionary, which is enlarged with the arrival of new symbol sequences.
  • 10. Encoding a sequence of symbols using LZW CodingEncoding a sequence of symbols using LZW Coding  The encoding process is be illustrated for one line of image having the following intensity values in sequence: 32 32 34 32 34 32 32 33 32 32 32 34.  Consider the table as below:
  • 11. Sequence:Sequence: 32 32 34 32 34 32 32 33 32 32 32 34.32 32 34 32 34 32 32 33 32 32 32 34.
  • 12. Decoding a Lempel-Ziv encoded sequenceDecoding a Lempel-Ziv encoded sequence
  • 13. Table 27-3 provides the step-by-step details for an example input file consisting of 45 bytes, the ASCII text string: the/rain/in/Spain/falls/mainly/on/the/plain. When we say that the LZW algorithm reads the character "a" from the input file, we mean it reads the value: 01100001 (97 expressed in 8 bits), where 97 is "a" in ASCII. When we say it writes the character "a" to the encoded file, we mean it writes: 000001100001 (97 expressed in 12 bits).
  • 14. Advantages and disadvantages of LZW codingAdvantages and disadvantages of LZW coding Advantages:  Extremely effective when there are repeated patterns in the data that are widely spread  Prior knowledge of probability of occurrence of symbols to be encoded is not required.  Simple coding technique with high compression ratio.  LZW compression is fast  Lossless compression technique Disadvantages:  Creates entries in the dictionary that may never be used.  LZW is a fairly old compression technique
  • 15. Applications of LZW codingApplications of LZW coding LZW compression can be used in a variety of file formats:  TIFF (tagged image file format )files  GIF (graphic interchange format ) files  PDF(portable document format) files  Unix Compress, gzip.  Suitable for compressing text files