SlideShare a Scribd company logo
Image Compression Techniques

             Presented by
               PARTHA PRATIM
  DEB
               MTECH(CSE),1st YEAR
Outline
     Image Compression Fundamentals
    ◦    Why Compress
    ◦    How is compression possible?
    ◦      Redundancy
    ◦      The Flow of Image Compression
    ◦      General Image Storage System
        Lossy compression:
     Reduce correlation between pixels
    ◦     Karhunen-Loeve Transform
    ◦     Discrete Cosine Transform
    ◦     Discrete Wavelet Transform
    ◦     Differential Pulse Code Modulation
    ◦     Differential Coding
       Lossless compression:
     Quantization and Source Coding
    ◦    Huffman Coding
    ◦    Arithmetic Coding
    ◦    Run Length Coding
    ◦    Lempel Ziv 77 Algorithm
    ◦    Lempel Ziv 78 Algorithm
     Overview of Image Compression Algorithms
    ◦    JPEG
    ◦    JPEG 2000
    ◦    Shape-Adaptive Image Compression
Outline
Image  Compression Fundamentals
Reduce correlation between pixels
Quantization and Source Coding
Overview of Image Compression
 Algorithms
The Flow of Image Compression
   What is the so-called image compression coding?
    ◦ To store the image into bit-stream as compact as possible and to display the
      decoded image in the monitor as exact as possible
   Flow of compression
    ◦ The image file is converted into a series of binary data, which is called the bit-
       stream
    ◦ The decoder receives the encoded bit-stream and decodes it to reconstruct the
       image
    ◦ The total data quantity of the bit-stream is less than the total data quantity of the
       original image
Basic concept of compression
spatial redundancy
        Elements that are duplicated within a structure, such as
       pixels in a still image and bit patterns in a file. Exploiting
       spatial redundancy is how compression is performed.




Intraframe coding
Compressing redundant areas within a single video frame.
Interframe coding
Interframe coding often provides substantial compression because in many motion sequences,
only a small percentage of the pixels are actually different from one frame to another.
General Image Storage System
Coding
 Java       Syntax:
   private int[] capture() throws InterruptedException {
   dim = Toolkit.getDefaultToolkit().getScreenSize();
   Image tmp = robot.createScreenCapture(new
    Rectangle(dim.width,dim.height)).getScaledInstance(800,600,BufferedImage.SCALE_SMOOTH);
   int pix[] = new int[IMG_WIDTH*IMG_HEIGHT];
   PixelGrabber pg = new PixelGrabber(tmp,0,0,IMG_WIDTH,IMG_HEIGHT,pix,0,IMG_WIDTH);
   pg.grabPixels();
   return pix;
   }
Outline
 ImageCompression Fundamentals
 Reduce correlation between pixels(lossy)
 Quantization and Source Coding
 Overview of Image Compression Algorithms
Reduce the Correlation between
   Pixels
Lossy compression:
 Orthogonal      Transform Coding
  ◦ KLT (Karhunen-Loeve Transform)
     Maximal Decorrelation Process
  ◦ DCT (Discrete Cosine Transform)
     JPEG is a DCT-based image compression standard, which is a lossy
      coding method and may result in some loss of details and
      unrecoverable distortion.
 Subband     Coding
  ◦ DWT (Discrete Wavelet Transform)
     To divide the spectrum of an image into the lowpass and the highpass
      components, DWT is a famous example.
     JPEG 2000 is a 2-dimension DWT based image compression standard.
 Predictive    Coding
  ◦ DPCM
     To remove mutual redundancy between successive pixels and encode
      only the new information
Outline
 ImageCompression Fundamentals
 Reduce correlation between pixels(lossy)
 Quantization and Source Coding(lossless)
 Overview of Image Compression Algorithms
Quantization and Source Coding
 Lossless compression techniques:
  Quantization
   ◦ The objective of quantization is to reduce the precision and to achieve higher
      compression ratio
   ◦ Lossy operation, which will result in loss of precision and unrecoverable
      distortion
  Source Coding
   ◦ To achieve less average length of bits per pixel of the image.
   ◦ Assigns short descriptions to the more frequent outcomes and long
      descriptions to the less frequent outcomes
   ◦ Entropy Coding Methods
         Huffman Coding
         Arithmetic Coding
         Run Length Coding
         Dictionary Codes
           Lempel-Ziv77
           Lempel-Ziv 78
Huffman Coding

Codeword
         Codeword X            Probability
 length
                       01     00       1        0
   2       01     1   0.25    0.3   0.45     0.55   1
                       10     01      00        1
   2       10     2   0.25   0.25    0.3     0.45
                       11     10      01
   3       11     3    0.2   0.25   0.25
                      000     11
   3      000     4   0.15    0.2
                      001
   3      001     5   0.15
Arithmetic Coding (1/3)
   Arithmetic Coding: a direct extension of Shannon-Fano-Elias coding
    calculate the probability mass function p(x n) and the cumulative distribution
    function F(xn) for the source sequence xn
    ◦ Lossless compression technique
    ◦ Treate multiple symbols as a single data unit
                                    Arithmetic Coding Algorithm
      Input symbol is l
      Previouslow is the lower bound for the old interval
      Previoushigh is the upper bound for the old interval
      Range is Previoushigh - Previouslow
      Let Previouslow= 0, Previoushigh = 1, Range = Previoushigh – Previouslow =1
      WHILE (input symbol != EOF)
        get input symbol l
        Range = Previoushigh - Previouslow
          New Previouslow = Previouslow + Range* intervallow of l
          New Previoushigh = Previouslow + Range* intervalhigh of l
      END
Arithmetic Coding (2/3)
   Symbol       Probability      Sub-interval     Input String : l l u u r e ?
        k          0.05          [0.00,0.05)
                                                                l l u u re ?
        l           0.2          [0.05,0.25)
        u           0.1          [0.20,0.35)                   0.0713348389
        w          0.05          [0.35,0.40)
                                                               =2-4+2-7+2-10+2-15+2-16
        e           0.3          [0.40,0.70)
        r           0.2          [0.70,0.90)    Codeword : 0001001001000011
        ?           0.2          [0.90,1.00)

            1             0.25           0.10   0.074    0.0714     0.07136   0.071336   0.0713360
 1.00

 0.90
            ?              ?               ?      ?        ?           ?          ?          ?
            r              r               r      r        r           r          r          r
 0.70

            e              e               e      e        e           e          e          e
 0.40

 0.35
            w              w               w      w        w           w          w          w
 0.25
            u              u               u      u        u           u          u          u

 0.05       l              l               l      l        l           l          l          l
    0
            k              k               k      k        k           k          k          k
            0             0.05           0.06   0.070    0.0710     0.07128    0.07132   0.0713336
Arithmetic Coding (3/3)
   Symbol     Probability   Huffman codeword
                                               Input String : l l u u r e ?
     k           0.05            10101
                                                           Huffman Coding 18 bits
     l            0.2              01
                                                              Codeword :
     u            0.1             100
                                                      01,01,100,100,00,11,1101
     w           0.05            10100
     e            0.3              11
                                                        Arithmetic Coding 16 bits
     r            0.2              00
                                                   Codeword : 0001001001000011
     ?            0.2             1011



 Arithmetic coding yields better compression because it encodes a message as
 a whole new symbol instead of separable symbols
 Most of the computations in arithmetic coding use floating-point arithmetic.
 However, most hardware can only support finite precision
    While a new symbol is coded, the precision required to present the range grows
    There is a potential for overflow and underflow
    If the fractional values are not scaled appropriately, the error of encoding occurs
Zero-Run-Length Coding-JPEG
          (1/2)
    The notation (L,F)
    ◦ L zeros in front of the nonzero value F
   EOB (End of Block)
    ◦ A special coded value means that the rest elements are all zeros
    ◦ If the last element of the vector is not zero, then the EOB marker will not be added
   An Example:
    1.57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ..., 0
    2. (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; EOB
    3. (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; (0,0)
    4. (0,6,111001);(0,6,101101);(4,5,10111);(1,5,00001);(0,4,0111);(2,1,1);(0,0)
    5.1111000 1111001 , 111000 101101 , 1111111110011000 10111 ,
            11111110110 00001 , 1011 0111 , 11100 1 , 1010
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
 It is not necessary for us to know the symbol probabilities
  beforehand. These codes take advantage of the fact that,
  quite often, certain strings of symbols are “frequently
  repeated” and these strings can be assigned code words that
  represent the “entire string of symbols”
 Two series
  ◦ Lempel-Ziv 77: LZ77, LZSS, LZBW
  ◦ Lempel-Ziv 78: LZ78, LZW, LZMW
Outline
Image  Compression Fundamentals
Reduce correlation between pixels
Quantization and Source Coding
Overview of Image Compression
 Algorithms
Outline
 ImageCompression Fundamentals
 Reduce correlation between pixels(lossy)
 Quantization and Source Coding(lossless)
 Overview of Image Compression Algorithms
Joint Photographic Experts Group (JPEG)
               The JPEG Encoder




               The JPEG Decoder
Reference

Digital
       image processing, by Rafael
 C.Gonzalez and Richard E.Woods
   page no:421-423,440-456,459-486.
THANK
       U
FOR UR PATIENCE

More Related Content

What's hot

Mpeg video compression
Mpeg video compressionMpeg video compression
Mpeg video compressionGem WeBlog
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standardsMazin Alwaaly
 
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsComparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsRishab2612
 
Image compression
Image compressionImage compression
Image compressionHuda Seyam
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domainAshish Kumar
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data CompressionPratik Pradhan
 
From Image Processing To Computer Vision
From Image Processing To Computer VisionFrom Image Processing To Computer Vision
From Image Processing To Computer VisionJoud Khattab
 
Multimedia graphics and image data representation
Multimedia graphics and image data representationMultimedia graphics and image data representation
Multimedia graphics and image data representationMazin Alwaaly
 
Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)danishrafiq
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processingVARUN KUMAR
 
Multimedia fundamental concepts in video
Multimedia fundamental concepts in videoMultimedia fundamental concepts in video
Multimedia fundamental concepts in videoMazin Alwaaly
 
Video Compression Techniques
Video Compression TechniquesVideo Compression Techniques
Video Compression Techniquescnssources
 

What's hot (20)

Mpeg video compression
Mpeg video compressionMpeg video compression
Mpeg video compression
 
Bit plane coding
Bit plane codingBit plane coding
Bit plane coding
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standardsComparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
Comparison between JPEG(DCT) and JPEG 2000(DWT) compression standards
 
Image compression
Image compressionImage compression
Image compression
 
Image compression
Image compressionImage compression
Image compression
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
 
Chapter 5 - Data Compression
Chapter 5 - Data CompressionChapter 5 - Data Compression
Chapter 5 - Data Compression
 
From Image Processing To Computer Vision
From Image Processing To Computer VisionFrom Image Processing To Computer Vision
From Image Processing To Computer Vision
 
A Comparison of Block-Matching Motion Estimation Algorithms
A Comparison of Block-Matching Motion Estimation AlgorithmsA Comparison of Block-Matching Motion Estimation Algorithms
A Comparison of Block-Matching Motion Estimation Algorithms
 
Multimedia graphics and image data representation
Multimedia graphics and image data representationMultimedia graphics and image data representation
Multimedia graphics and image data representation
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)Compression: Video Compression (MPEG and others)
Compression: Video Compression (MPEG and others)
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
Multimedia fundamental concepts in video
Multimedia fundamental concepts in videoMultimedia fundamental concepts in video
Multimedia fundamental concepts in video
 
Video Compression Techniques
Video Compression TechniquesVideo Compression Techniques
Video Compression Techniques
 

Similar to Image compression

image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compressionZaabir Ali
 
jpg image processing nagham salim_as.ppt
jpg image processing nagham salim_as.pptjpg image processing nagham salim_as.ppt
jpg image processing nagham salim_as.pptnaghamallella
 
Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –Alexander Decker
 
M4L1.ppt
M4L1.pptM4L1.ppt
M4L1.pptdudoo1
 
Image compression- JPEG Compression & its Modes
Image compression- JPEG Compression & its ModesImage compression- JPEG Compression & its Modes
Image compression- JPEG Compression & its Modeskanimozhirajasekaren
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptxAliaaTarek5
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemRekha dudiya
 
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...Positive Hack Days
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplifiedLovelyn Rose
 
Adobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGALAdobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGALDaniel Freeman
 
DEF CON 23 - Atlas - fun with symboliks
DEF CON 23 - Atlas - fun with symboliksDEF CON 23 - Atlas - fun with symboliks
DEF CON 23 - Atlas - fun with symboliksFelipe Prado
 

Similar to Image compression (20)

image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
 
jpg image processing nagham salim_as.ppt
jpg image processing nagham salim_as.pptjpg image processing nagham salim_as.ppt
jpg image processing nagham salim_as.ppt
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –A new approach to ward off error propagation effect of aes –
A new approach to ward off error propagation effect of aes –
 
Differential games
Differential gamesDifferential games
Differential games
 
Dpsd lecture-notes
Dpsd lecture-notesDpsd lecture-notes
Dpsd lecture-notes
 
Process.org
Process.orgProcess.org
Process.org
 
Shereef_MP3_decoder
Shereef_MP3_decoderShereef_MP3_decoder
Shereef_MP3_decoder
 
M4L1.ppt
M4L1.pptM4L1.ppt
M4L1.ppt
 
Image compression- JPEG Compression & its Modes
Image compression- JPEG Compression & its ModesImage compression- JPEG Compression & its Modes
Image compression- JPEG Compression & its Modes
 
Wp Sampling1 4
Wp Sampling1 4Wp Sampling1 4
Wp Sampling1 4
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptx
 
project ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction systemproject ppt on anti counterfeiting technique for credit card transaction system
project ppt on anti counterfeiting technique for credit card transaction system
 
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
The System of Automatic Searching for Vulnerabilities or how to use Taint Ana...
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplified
 
Count that face
Count that faceCount that face
Count that face
 
Adobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGALAdobe AIR: Stage3D and AGAL
Adobe AIR: Stage3D and AGAL
 
DEF CON 23 - Atlas - fun with symboliks
DEF CON 23 - Atlas - fun with symboliksDEF CON 23 - Atlas - fun with symboliks
DEF CON 23 - Atlas - fun with symboliks
 
Module 4
Module 4Module 4
Module 4
 

Recently uploaded

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 

Recently uploaded (20)

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 

Image compression

  • 1. Image Compression Techniques Presented by PARTHA PRATIM DEB MTECH(CSE),1st YEAR
  • 2. Outline  Image Compression Fundamentals ◦ Why Compress ◦ How is compression possible? ◦ Redundancy ◦ The Flow of Image Compression ◦ General Image Storage System Lossy compression:  Reduce correlation between pixels ◦ Karhunen-Loeve Transform ◦ Discrete Cosine Transform ◦ Discrete Wavelet Transform ◦ Differential Pulse Code Modulation ◦ Differential Coding  Lossless compression:  Quantization and Source Coding ◦ Huffman Coding ◦ Arithmetic Coding ◦ Run Length Coding ◦ Lempel Ziv 77 Algorithm ◦ Lempel Ziv 78 Algorithm  Overview of Image Compression Algorithms ◦ JPEG ◦ JPEG 2000 ◦ Shape-Adaptive Image Compression
  • 3. Outline Image Compression Fundamentals Reduce correlation between pixels Quantization and Source Coding Overview of Image Compression Algorithms
  • 4. The Flow of Image Compression  What is the so-called image compression coding? ◦ To store the image into bit-stream as compact as possible and to display the decoded image in the monitor as exact as possible  Flow of compression ◦ The image file is converted into a series of binary data, which is called the bit- stream ◦ The decoder receives the encoded bit-stream and decodes it to reconstruct the image ◦ The total data quantity of the bit-stream is less than the total data quantity of the original image
  • 5. Basic concept of compression
  • 6. spatial redundancy Elements that are duplicated within a structure, such as pixels in a still image and bit patterns in a file. Exploiting spatial redundancy is how compression is performed. Intraframe coding Compressing redundant areas within a single video frame. Interframe coding Interframe coding often provides substantial compression because in many motion sequences, only a small percentage of the pixels are actually different from one frame to another.
  • 8. Coding  Java Syntax:  private int[] capture() throws InterruptedException {  dim = Toolkit.getDefaultToolkit().getScreenSize();  Image tmp = robot.createScreenCapture(new Rectangle(dim.width,dim.height)).getScaledInstance(800,600,BufferedImage.SCALE_SMOOTH);  int pix[] = new int[IMG_WIDTH*IMG_HEIGHT];  PixelGrabber pg = new PixelGrabber(tmp,0,0,IMG_WIDTH,IMG_HEIGHT,pix,0,IMG_WIDTH);  pg.grabPixels();  return pix;  }
  • 9. Outline  ImageCompression Fundamentals  Reduce correlation between pixels(lossy)  Quantization and Source Coding  Overview of Image Compression Algorithms
  • 10. Reduce the Correlation between Pixels Lossy compression:  Orthogonal Transform Coding ◦ KLT (Karhunen-Loeve Transform)  Maximal Decorrelation Process ◦ DCT (Discrete Cosine Transform)  JPEG is a DCT-based image compression standard, which is a lossy coding method and may result in some loss of details and unrecoverable distortion.  Subband Coding ◦ DWT (Discrete Wavelet Transform)  To divide the spectrum of an image into the lowpass and the highpass components, DWT is a famous example.  JPEG 2000 is a 2-dimension DWT based image compression standard.  Predictive Coding ◦ DPCM  To remove mutual redundancy between successive pixels and encode only the new information
  • 11.
  • 12.
  • 13.
  • 14. Outline  ImageCompression Fundamentals  Reduce correlation between pixels(lossy)  Quantization and Source Coding(lossless)  Overview of Image Compression Algorithms
  • 15. Quantization and Source Coding Lossless compression techniques:  Quantization ◦ The objective of quantization is to reduce the precision and to achieve higher compression ratio ◦ Lossy operation, which will result in loss of precision and unrecoverable distortion  Source Coding ◦ To achieve less average length of bits per pixel of the image. ◦ Assigns short descriptions to the more frequent outcomes and long descriptions to the less frequent outcomes ◦ Entropy Coding Methods  Huffman Coding  Arithmetic Coding  Run Length Coding  Dictionary Codes  Lempel-Ziv77  Lempel-Ziv 78
  • 16. Huffman Coding Codeword Codeword X Probability length 01 00 1 0 2 01 1 0.25 0.3 0.45 0.55 1 10 01 00 1 2 10 2 0.25 0.25 0.3 0.45 11 10 01 3 11 3 0.2 0.25 0.25 000 11 3 000 4 0.15 0.2 001 3 001 5 0.15
  • 17. Arithmetic Coding (1/3)  Arithmetic Coding: a direct extension of Shannon-Fano-Elias coding calculate the probability mass function p(x n) and the cumulative distribution function F(xn) for the source sequence xn ◦ Lossless compression technique ◦ Treate multiple symbols as a single data unit Arithmetic Coding Algorithm Input symbol is l Previouslow is the lower bound for the old interval Previoushigh is the upper bound for the old interval Range is Previoushigh - Previouslow Let Previouslow= 0, Previoushigh = 1, Range = Previoushigh – Previouslow =1 WHILE (input symbol != EOF) get input symbol l Range = Previoushigh - Previouslow New Previouslow = Previouslow + Range* intervallow of l New Previoushigh = Previouslow + Range* intervalhigh of l END
  • 18. Arithmetic Coding (2/3) Symbol Probability Sub-interval Input String : l l u u r e ? k 0.05 [0.00,0.05) l l u u re ? l 0.2 [0.05,0.25) u 0.1 [0.20,0.35) 0.0713348389 w 0.05 [0.35,0.40) =2-4+2-7+2-10+2-15+2-16 e 0.3 [0.40,0.70) r 0.2 [0.70,0.90) Codeword : 0001001001000011 ? 0.2 [0.90,1.00) 1 0.25 0.10 0.074 0.0714 0.07136 0.071336 0.0713360 1.00 0.90 ? ? ? ? ? ? ? ? r r r r r r r r 0.70 e e e e e e e e 0.40 0.35 w w w w w w w w 0.25 u u u u u u u u 0.05 l l l l l l l l 0 k k k k k k k k 0 0.05 0.06 0.070 0.0710 0.07128 0.07132 0.0713336
  • 19. Arithmetic Coding (3/3) Symbol Probability Huffman codeword Input String : l l u u r e ? k 0.05 10101 Huffman Coding 18 bits l 0.2 01 Codeword : u 0.1 100 01,01,100,100,00,11,1101 w 0.05 10100 e 0.3 11 Arithmetic Coding 16 bits r 0.2 00 Codeword : 0001001001000011 ? 0.2 1011 Arithmetic coding yields better compression because it encodes a message as a whole new symbol instead of separable symbols Most of the computations in arithmetic coding use floating-point arithmetic. However, most hardware can only support finite precision While a new symbol is coded, the precision required to present the range grows There is a potential for overflow and underflow If the fractional values are not scaled appropriately, the error of encoding occurs
  • 20. Zero-Run-Length Coding-JPEG  (1/2) The notation (L,F) ◦ L zeros in front of the nonzero value F  EOB (End of Block) ◦ A special coded value means that the rest elements are all zeros ◦ If the last element of the vector is not zero, then the EOB marker will not be added  An Example: 1.57, 45, 0, 0, 0, 0, 23, 0, -30, -16, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, ..., 0 2. (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; EOB 3. (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-16) ; (2,1) ; (0,0) 4. (0,6,111001);(0,6,101101);(4,5,10111);(1,5,00001);(0,4,0111);(2,1,1);(0,0) 5.1111000 1111001 , 111000 101101 , 1111111110011000 10111 , 11111110110 00001 , 1011 0111 , 11100 1 , 1010
  • 21. 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  It is not necessary for us to know the symbol probabilities beforehand. These codes take advantage of the fact that, quite often, certain strings of symbols are “frequently repeated” and these strings can be assigned code words that represent the “entire string of symbols”  Two series ◦ Lempel-Ziv 77: LZ77, LZSS, LZBW ◦ Lempel-Ziv 78: LZ78, LZW, LZMW
  • 22. Outline Image Compression Fundamentals Reduce correlation between pixels Quantization and Source Coding Overview of Image Compression Algorithms
  • 23. Outline  ImageCompression Fundamentals  Reduce correlation between pixels(lossy)  Quantization and Source Coding(lossless)  Overview of Image Compression Algorithms
  • 24. Joint Photographic Experts Group (JPEG) The JPEG Encoder The JPEG Decoder
  • 25. Reference Digital image processing, by Rafael C.Gonzalez and Richard E.Woods page no:421-423,440-456,459-486.
  • 26. THANK U FOR UR PATIENCE