SlideShare a Scribd company logo
1 of 65
Lossy and Lossless
Gufran Siddique
Mohd. Salman Khan
Under:
Mr. Nadeem Akhtar
 Allows the exact original data to be reconstructed from
the compressed data.
 Common Algorithms:
 LZW
 Huffman Coding
 Deflate
 Gif
 PNG
 Allows constructing an approximation of the original
data from the compressed data.
 Common Algorithms:
 Jpeg
 Jpeg 2000
 Fractal compression
 Wavelet Compression
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 0
181 0
182 0
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 0
181 0 0 + 3 = 3
182 0
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 0
181 3
182 0 0 + 4 = 4
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 0 0 + 5 = 5
181 3
182 4
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 5 5 + 5 = 10
181 3
182 4
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 10 10 + 5 = 15
181 3
182 4
183 0
184 1
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 15
181 3
182 4
183 0
184 1 1 + 16 = 17
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 15
181 3 3 + 18 = 21
182 4
183 0
184 17
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 15
181 21 21 + 18 = 39
182 4
183 0
184 17
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 15 15 + 40 = 55
181 39
182 4
183 0
184 17
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 39
182 4
183 0
184 17 17 + 56 = 73
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 39
182 4 4 + 74 = 78
183 0
184 73
185 0
186 0
187 2
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 39
182 78
183 0
184 73
185 0
186 0
187 2 2 + 79 = 81
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 39 39 + 82 = 121
182 78
183 0
184 73
185 0
186 0
187 81
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 121
182 78
183 0
184 73
185 0
186 0
187 81 81 + 122 = 203
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55
181 121
182 78
183 0
184 73
185 0
186 0
187 203 203 + 122 = 325
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 55 55 + 326 = 381
181 121
182 78
183 0
184 73
185 0
186 0
187 325
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 381
181 121
182 78
183 0
184 73
185 0
186 0
187 325
<---8--->
Start
<---4--->
Distinct Numbers
<---4--->
Bits Occupied by
the maximum sum
<--- Dn * Bms --->
8
180
4
5
4
9
9
381
9
121
9
78
9
73
9
325
180 381
181 121
182 78
183 0
184 73
185 0
186 0
187 325
8
180
4
5
4
9
9
381
9
121
9
78
9
73
9
325
1 381
2 121
3 78
4 73
5 325
1
1 381 381 – 326 = 55
2 121
3 78
4 73
5 325
5 1
1 55
2 121
3 78
4 73
5 325 325 – 122 = 203
5 5 1
1 55
2 121
3 78
4 73
5 203 203 – 122 = 81
2 5 5 1
1 55
2 121 121 – 82 = 39
3 78
4 73
5 81
5
2 5 5 1
1 55
2 39
3 78
4 73
5 81 81 – 79 = 2
3 5
2 5 5 1
1 55
2 39
3 78 78 – 74 = 4
4 73
5 2
4 3 5
2 5 5 1
1 55
2 39
3 4
4 73 73 – 56 = 17
5 2
1 4 3 5
2 5 5 1
1 55 55 – 40 = 15
2 39
3 4
4 17
5 2
2
1 4 3 5
2 5 5 1
1 15
2 39 39 – 18 = 21
3 4
4 17
5 2
2 2
1 4 3 5
2 5 5 1
1 15
2 21 21 – 18 = 3
3 4
4 17
5 2
4 2 2
1 4 3 5
2 5 5 1
1 15
2 3
3 4
4 17 17 – 16 = 1
5 2
1 4 2 2
1 4 3 5
2 5 5 1
1 15 15 – 5 = 10
2 3
3 4
4 1
5 2
1
1 4 2 2
1 4 3 5
2 5 5 1
1 10 10 – 5 = 5
2 3
3 4
4 1
5 2
1 1
1 4 2 2
1 4 3 5
2 5 5 1
1 5 5 – 5 = 0
2 3
3 4
4 1
5 2
3 1 1
1 4 2 2
1 4 3 5
2 5 5 1
1 0
2 3
3 4 4 – 4 = 0
4 1
5 2
2 3 1 1
1 4 2 2
1 4 3 5
2 5 5 1
1 0
2 3 3 – 3 = 0
3 0
4 1
5 2
2 3 1 1
1 4 2 2
1 4 3 5
2 5 5 1
1 0 180
2 0 181
3 0 182
4 1 184
5 2 187
2 3 1 1
1 4 2 2
1 4 3 5
2 5 5 1
1 180
2 181
3 182
4 184
5 187
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
Quantization factor (QF) = 2,3,4 …
𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒 =
𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒
𝑄𝐹
∗ 𝑄𝐹
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
180 182 180 180
180 184 180 180
180 184 182 186
180 186 186 180
180 0
181 0
182 0
183 0
184 0
185 0
186 0
187 0
180 0
181 0
182 0
183 0
184 1
185 0
186 0
187 2
180 182 180 180
180 184 180 180
180 184 182 186
180 186 186 180
180 381
181 121
182 78
183 0
184 73
185 0
186 0
187 325
180 392
181 0
182 61
183 0
184 58
185 0
186 282
187 0
181 182 180 180
180 184 181 181
180 184 182 187
181 187 187 180
Start = 180
Distinct numbers = 4
Maximum number = 391 (9 bits)
Total bits = 8 + 4 + 4 + 4*9
= 52 bits
Raw data = 128 bits
Saved = 76 bits
180 392
181 0
182 61
183 0
184 58
185 0
186 282
187 0
Smoothing factor (SF) = 1,2,3 …
If ( 𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒 − 𝑐ℎ𝑒𝑐𝑘 𝑡𝑎𝑏𝑙𝑒 < 𝑆𝐹 ) return tablevalue
Else add(pixelvalue in the table)
180 182 180 180
180 184 180 180
180 184 182 186
180 186 186 180
180 180 180 180
180 184 180 180
180 184 180 184
180 184 184 180
180 180
184
180 182 180 180
180 184 180 180
180 184 182 186
180 186 186 180
180 180 180 180
180 184 180 180
180 184 180 184
180 184 184 180
180 392
181 0
182 61
183 0
184 58
185 0
186 282
187 0
180 710
181 0
182 0
183 0
184 513
185 0
186 0
187 0
Start = 180
Distinct numbers = 2
Maximum number = 710 (10 bits)
Total bits = 8 + 4 + 4 + 2*10
= 36 bits
Raw data = 128 bits
Saved = 92 bits
180 710
181 0
182 0
183 0
184 513
185 0
186 0
187 0
LENA (512*512)
 Pgm = 262144 Bytes
 Gif = 264,618 Bytes
 Tiff (LZW) = 263,532 Bytes
 Tiff (Deflate) = 225,174 Bytes
 Png = 151,217 Bytes
 AMU = 200,353 Bytes
AMU Compression ratio = 76.42
BARBARA (512*512)
 Pgm = 262144 Bytes
 Gif = 291,701 Bytes
 Tiff (LZW) = 290,052 Bytes
 Tiff (Deflate) = 236,416 Bytes
 Png = 177,872 Bytes
 AMU = 219,774 Bytes
AMU Compression ratio = 83.83
F16 (512*512)
 Pgm = 262144 Bytes
 Gif = 213,463 Bytes
 Tiff (LZW) = 212,762 Bytes
 Tiff (Deflate) = 188,434 Bytes
 Png = 139,403 Bytes
 AMU = 188,300 Bytes
AMU Compression ratio = 71.83
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression
Addition based lossless Image Compression

More Related Content

What's hot

What's hot (12)

Inova
InovaInova
Inova
 
DIVISIONES SUCESIVAS Y DESCOMPOSICIONES POLINOMICAS
DIVISIONES SUCESIVAS Y DESCOMPOSICIONES POLINOMICASDIVISIONES SUCESIVAS Y DESCOMPOSICIONES POLINOMICAS
DIVISIONES SUCESIVAS Y DESCOMPOSICIONES POLINOMICAS
 
Evan craft entrego todo a ti
Evan craft   entrego todo a tiEvan craft   entrego todo a ti
Evan craft entrego todo a ti
 
Forever aloe vera gel
Forever aloe vera gelForever aloe vera gel
Forever aloe vera gel
 
Divisiones sucesivas
Divisiones sucesivasDivisiones sucesivas
Divisiones sucesivas
 
Vetores na regra do poligonal
Vetores na regra do poligonalVetores na regra do poligonal
Vetores na regra do poligonal
 
配色
配色配色
配色
 
SISTEMA DE NUMERACION
SISTEMA DE NUMERACIONSISTEMA DE NUMERACION
SISTEMA DE NUMERACION
 
Devoir2 1
Devoir2 1Devoir2 1
Devoir2 1
 
Магадлал статистикийн онол бие даалт
Магадлал статистикийн онол бие даалтМагадлал статистикийн онол бие даалт
Магадлал статистикийн онол бие даалт
 
Divisiones sucesivas
Divisiones sucesivasDivisiones sucesivas
Divisiones sucesivas
 
Operacionescombianadasenteros
OperacionescombianadasenterosOperacionescombianadasenteros
Operacionescombianadasenteros
 

Viewers also liked

Using time frequency and wavelet analysis to assess turbulence-rotor interact...
Using time frequency and wavelet analysis to assess turbulence-rotor interact...Using time frequency and wavelet analysis to assess turbulence-rotor interact...
Using time frequency and wavelet analysis to assess turbulence-rotor interact...ndkelley
 
iPRES 2016 - Practical analysis of tiff file size reductions achievable
iPRES 2016 - Practical analysis of tiff file size reductions achievableiPRES 2016 - Practical analysis of tiff file size reductions achievable
iPRES 2016 - Practical analysis of tiff file size reductions achievablePeter May
 
Common image compression formats
Common image compression formatsCommon image compression formats
Common image compression formatsClyde Lettsome
 
Image compression using discrete wavelet transform
Image compression using discrete wavelet transformImage compression using discrete wavelet transform
Image compression using discrete wavelet transformHarshal Ladhe
 
PPT Image Analysis(IRDE, DRDO)
PPT Image Analysis(IRDE, DRDO)PPT Image Analysis(IRDE, DRDO)
PPT Image Analysis(IRDE, DRDO)Nidhi Gopal
 
M.Tech project on Haar wavelet based approach for image compression
M.Tech project on Haar wavelet based approach for image compressionM.Tech project on Haar wavelet based approach for image compression
M.Tech project on Haar wavelet based approach for image compressionVeerendra B R Revanna
 
Lossless Compression
Lossless CompressionLossless Compression
Lossless CompressionPuchpa Oks
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression techniquePriyanka Pachori
 
Introduction to wavelet transform
Introduction to wavelet transformIntroduction to wavelet transform
Introduction to wavelet transformRaj Endiran
 
discrete wavelet transform
discrete wavelet transformdiscrete wavelet transform
discrete wavelet transformpiyush_11
 

Viewers also liked (12)

Using time frequency and wavelet analysis to assess turbulence-rotor interact...
Using time frequency and wavelet analysis to assess turbulence-rotor interact...Using time frequency and wavelet analysis to assess turbulence-rotor interact...
Using time frequency and wavelet analysis to assess turbulence-rotor interact...
 
iPRES 2016 - Practical analysis of tiff file size reductions achievable
iPRES 2016 - Practical analysis of tiff file size reductions achievableiPRES 2016 - Practical analysis of tiff file size reductions achievable
iPRES 2016 - Practical analysis of tiff file size reductions achievable
 
Common image compression formats
Common image compression formatsCommon image compression formats
Common image compression formats
 
Image compression using discrete wavelet transform
Image compression using discrete wavelet transformImage compression using discrete wavelet transform
Image compression using discrete wavelet transform
 
PPT Image Analysis(IRDE, DRDO)
PPT Image Analysis(IRDE, DRDO)PPT Image Analysis(IRDE, DRDO)
PPT Image Analysis(IRDE, DRDO)
 
M.Tech project on Haar wavelet based approach for image compression
M.Tech project on Haar wavelet based approach for image compressionM.Tech project on Haar wavelet based approach for image compression
M.Tech project on Haar wavelet based approach for image compression
 
Lossless Compression
Lossless CompressionLossless Compression
Lossless Compression
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression technique
 
Image compression
Image compressionImage compression
Image compression
 
Introduction to wavelet transform
Introduction to wavelet transformIntroduction to wavelet transform
Introduction to wavelet transform
 
discrete wavelet transform
discrete wavelet transformdiscrete wavelet transform
discrete wavelet transform
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 

Addition based lossless Image Compression

  • 1. Lossy and Lossless Gufran Siddique Mohd. Salman Khan Under: Mr. Nadeem Akhtar
  • 2.  Allows the exact original data to be reconstructed from the compressed data.  Common Algorithms:  LZW  Huffman Coding  Deflate  Gif  PNG
  • 3.  Allows constructing an approximation of the original data from the compressed data.  Common Algorithms:  Jpeg  Jpeg 2000  Fractal compression  Wavelet Compression
  • 4.
  • 5. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 0 181 0 182 0 183 0 184 1 185 0 186 0 187 2
  • 6. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 0 181 0 0 + 3 = 3 182 0 183 0 184 1 185 0 186 0 187 2
  • 7. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 0 181 3 182 0 0 + 4 = 4 183 0 184 1 185 0 186 0 187 2
  • 8. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 0 0 + 5 = 5 181 3 182 4 183 0 184 1 185 0 186 0 187 2
  • 9. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 5 5 + 5 = 10 181 3 182 4 183 0 184 1 185 0 186 0 187 2
  • 10. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 10 10 + 5 = 15 181 3 182 4 183 0 184 1 185 0 186 0 187 2
  • 11. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 15 181 3 182 4 183 0 184 1 1 + 16 = 17 185 0 186 0 187 2
  • 12. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 15 181 3 3 + 18 = 21 182 4 183 0 184 17 185 0 186 0 187 2
  • 13. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 15 181 21 21 + 18 = 39 182 4 183 0 184 17 185 0 186 0 187 2
  • 14. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 15 15 + 40 = 55 181 39 182 4 183 0 184 17 185 0 186 0 187 2
  • 15. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 39 182 4 183 0 184 17 17 + 56 = 73 185 0 186 0 187 2
  • 16. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 39 182 4 4 + 74 = 78 183 0 184 73 185 0 186 0 187 2
  • 17. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 39 182 78 183 0 184 73 185 0 186 0 187 2 2 + 79 = 81
  • 18. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 39 39 + 82 = 121 182 78 183 0 184 73 185 0 186 0 187 81
  • 19. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 121 182 78 183 0 184 73 185 0 186 0 187 81 81 + 122 = 203
  • 20. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 181 121 182 78 183 0 184 73 185 0 186 0 187 203 203 + 122 = 325
  • 21. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 55 55 + 326 = 381 181 121 182 78 183 0 184 73 185 0 186 0 187 325
  • 22. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 381 181 121 182 78 183 0 184 73 185 0 186 0 187 325
  • 26. 1 1 381 381 – 326 = 55 2 121 3 78 4 73 5 325
  • 27. 5 1 1 55 2 121 3 78 4 73 5 325 325 – 122 = 203
  • 28. 5 5 1 1 55 2 121 3 78 4 73 5 203 203 – 122 = 81
  • 29. 2 5 5 1 1 55 2 121 121 – 82 = 39 3 78 4 73 5 81
  • 30. 5 2 5 5 1 1 55 2 39 3 78 4 73 5 81 81 – 79 = 2
  • 31. 3 5 2 5 5 1 1 55 2 39 3 78 78 – 74 = 4 4 73 5 2
  • 32. 4 3 5 2 5 5 1 1 55 2 39 3 4 4 73 73 – 56 = 17 5 2
  • 33. 1 4 3 5 2 5 5 1 1 55 55 – 40 = 15 2 39 3 4 4 17 5 2
  • 34. 2 1 4 3 5 2 5 5 1 1 15 2 39 39 – 18 = 21 3 4 4 17 5 2
  • 35. 2 2 1 4 3 5 2 5 5 1 1 15 2 21 21 – 18 = 3 3 4 4 17 5 2
  • 36. 4 2 2 1 4 3 5 2 5 5 1 1 15 2 3 3 4 4 17 17 – 16 = 1 5 2
  • 37. 1 4 2 2 1 4 3 5 2 5 5 1 1 15 15 – 5 = 10 2 3 3 4 4 1 5 2
  • 38. 1 1 4 2 2 1 4 3 5 2 5 5 1 1 10 10 – 5 = 5 2 3 3 4 4 1 5 2
  • 39. 1 1 1 4 2 2 1 4 3 5 2 5 5 1 1 5 5 – 5 = 0 2 3 3 4 4 1 5 2
  • 40. 3 1 1 1 4 2 2 1 4 3 5 2 5 5 1 1 0 2 3 3 4 4 – 4 = 0 4 1 5 2
  • 41. 2 3 1 1 1 4 2 2 1 4 3 5 2 5 5 1 1 0 2 3 3 – 3 = 0 3 0 4 1 5 2
  • 42. 2 3 1 1 1 4 2 2 1 4 3 5 2 5 5 1 1 0 180 2 0 181 3 0 182 4 1 184 5 2 187
  • 43. 2 3 1 1 1 4 2 2 1 4 3 5 2 5 5 1 1 180 2 181 3 182 4 184 5 187 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180
  • 44.
  • 45. Quantization factor (QF) = 2,3,4 … 𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒 = 𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒 𝑄𝐹 ∗ 𝑄𝐹
  • 46. 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180 180 182 180 180 180 184 180 180 180 184 182 186 180 186 186 180 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 180 0 181 0 182 0 183 0 184 1 185 0 186 0 187 2
  • 47. 180 182 180 180 180 184 180 180 180 184 182 186 180 186 186 180 180 381 181 121 182 78 183 0 184 73 185 0 186 0 187 325 180 392 181 0 182 61 183 0 184 58 185 0 186 282 187 0 181 182 180 180 180 184 181 181 180 184 182 187 181 187 187 180
  • 48. Start = 180 Distinct numbers = 4 Maximum number = 391 (9 bits) Total bits = 8 + 4 + 4 + 4*9 = 52 bits Raw data = 128 bits Saved = 76 bits 180 392 181 0 182 61 183 0 184 58 185 0 186 282 187 0
  • 49. Smoothing factor (SF) = 1,2,3 … If ( 𝑝𝑖𝑥𝑒𝑙𝑣𝑎𝑙𝑢𝑒 − 𝑐ℎ𝑒𝑐𝑘 𝑡𝑎𝑏𝑙𝑒 < 𝑆𝐹 ) return tablevalue Else add(pixelvalue in the table)
  • 50. 180 182 180 180 180 184 180 180 180 184 182 186 180 186 186 180 180 180 180 180 180 184 180 180 180 184 180 184 180 184 184 180 180 180 184
  • 51. 180 182 180 180 180 184 180 180 180 184 182 186 180 186 186 180 180 180 180 180 180 184 180 180 180 184 180 184 180 184 184 180 180 392 181 0 182 61 183 0 184 58 185 0 186 282 187 0 180 710 181 0 182 0 183 0 184 513 185 0 186 0 187 0
  • 52. Start = 180 Distinct numbers = 2 Maximum number = 710 (10 bits) Total bits = 8 + 4 + 4 + 2*10 = 36 bits Raw data = 128 bits Saved = 92 bits 180 710 181 0 182 0 183 0 184 513 185 0 186 0 187 0
  • 53.
  • 54. LENA (512*512)  Pgm = 262144 Bytes  Gif = 264,618 Bytes  Tiff (LZW) = 263,532 Bytes  Tiff (Deflate) = 225,174 Bytes  Png = 151,217 Bytes  AMU = 200,353 Bytes AMU Compression ratio = 76.42
  • 55. BARBARA (512*512)  Pgm = 262144 Bytes  Gif = 291,701 Bytes  Tiff (LZW) = 290,052 Bytes  Tiff (Deflate) = 236,416 Bytes  Png = 177,872 Bytes  AMU = 219,774 Bytes AMU Compression ratio = 83.83
  • 56. F16 (512*512)  Pgm = 262144 Bytes  Gif = 213,463 Bytes  Tiff (LZW) = 212,762 Bytes  Tiff (Deflate) = 188,434 Bytes  Png = 139,403 Bytes  AMU = 188,300 Bytes AMU Compression ratio = 71.83