SlideShare a Scribd company logo
1 of 19
Lossy Compression
By:
Mahmoud Hikmet Bzhar Omer
Supervisor:
Dr.Roojwan Sdiq
Overview
โ€ข What's Comparession ?
โ€ข Whatโ€™s lossless and lossy compression ?
โ€ข Whatโ€™s JPEG?
โ€ข The Major Steps in JPEG Coding involve:
๏ƒผ Transform RGB to YIQ or YUV and subsample color.
๏ƒผ DCT(Discrete Cosine Transformation).
๏ƒผ Quantization.
๏ƒผ Zig-zag ordering
๏ƒผ DPCM on DC component
๏ƒผ Run-length encoding.
๏ƒผ Entropy coding.
What is Comparession ?
โ€ข Compression is the reduction in size of data
in order to save space or transmission time.
Learn how files are compressed .
Whatโ€™s lossless and lossy
compression ?
โ€ข Lossless: The compression of a file, all original
data can be recovered when the file is
uncompressed.
โ€ข Lossy : -The compressed data is not the
same as the original data, but a close
approximation of it.
What is JPEG?
โ€ข "Joint Photographic Expert Group" -- an
international standard in 1992.
โ€ข Works with colour and greyscale images, Many
applications e.g., satellite, medical, ..
JPEG compression involves the following:
DCT : Discrete Cosine Transform
โ€ข DCT converts the information contained in a block(8x8)
of pixels from spatial domain to the frequency domain.
1-D DCT: 1-D Inverese DCT:
๏ƒฅ
๏€ญ
๏€ฝ
๏€ซ
๏€ฝ
1N
0n
2N
1)(2n
f(n)cos
2
a(u))F( ๏ท๏ฐ
๏ท ๏ƒฅ
๏€ญ
๏€ฝ
๏€ซ
๏€ฝ
1N
0
2N
1)(2n
)cosF(
2
a(u))(fโ€™
๏ท
๏ท๏ฐ
๏ทn
๏› ๏0p1a(p)
2
1a(0)
๏‚น๏€ฝ
๏€ฝ
Examplesubimage2*2
154 123
192 186
D
Subtract 128 from each value to convert to signed
26 -5
64 58
D
First Row= 2
1
secondRow= 2N
1)(2n
cos
๏ท๏ฐ๏€ซ
N/2
1- = 0.7071
2-
2
1
N*2
1)(2n
cos
๏ท๏ฐ๏€ซ
N/2
D(1,0)= 2*2
*1)0*(2
cos
๏ฐ1๏€ซ
2/2
D(1,0)= 4
cos
๏ฐ
D(1,0)=0.7071
D(1,1)= 2*2
*1)1*(2
cos
๏ฐ1๏€ซ
2/2
D(1,1)= 4
cos
๏ฐ3
D(1,1)=-0.7071
0.7071 0.7071
0.7071 -0.7071
T
0.7071 0.7071
0.7071 -0.7071
0.7071 0.7071
0.7071 -0.7071
26 -5
64 58* *
T D -T
63.639 33.234
-26.87 -40.305
0.7071 0.7071
0.7071 -0.7071*
68.5 21.5
-47.5 9.5DCT=
Quantization:
โ€ข The quantization step is the main source for loss in JPEG
compression
โ€ข Encoder: Each value in the current block is divided by 16
and rounded down to create the quantised block.
โ€ข Round(DCT/Q)
68.5 21.5
-47.5 9.5
16 11
12 12
Q
4 2
-4 1
4 2
-4 1
QDCT
Quantization:
โ€ข The quantization step is the main source for loss in JPEG
compression.
โ€ข Decoder: Each value in the quantised block is multiplied
by quntize block.
4 2
-4 1
QDCT
16 11
12 12*
64 22
-48 12
Q-1
โ€ข DCT-1=round(T*Q-1*T)+128
DCT-inverse
0.7071 0.7071
0.7071 -0.7071
0.7071 0.7071
0.7071 -0.7071
26 -5
64 58
T Q-1 -T
* *
11.314 24.041
79.195 7.071 *
0.7071 0.7071
0.7071 -0.7071
=
=
= 25 -9
61 51
+
128 128
128 128
153 119
189 179
=
154 123
192 186
D
- 153 119
189 179
DCT-1
1 4
3 7
=
Zig-Zag Scan
โ€ข Why? to group low frequency coefficients in top of vector and high
frequency coefficients at the bottom
โˆ’26, โˆ’3, 0, โˆ’3, โˆ’2, โˆ’6, 2, โˆ’4, 1, โˆ’4, 1, 1, 5, 1, 2, โˆ’1, 1, โˆ’1, 2, 0, 0, 0,
0, 0, โˆ’1, โˆ’1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EOB
โ€ข The 1x64 vectors have a lot of zeros in them, more so towards the end
of the vector.
โ€ข Higher up entries in the vector capture higher frequency (DCT) components
which tend to be capture less of the content.
โ€ข Could have been as a result of using a quantization table
โ€ข Encode a series of 0s as a (skip,value) pair, where skip is the number of
zeros and value is the next non-zero component.
โ€ข Send (0,0) as end-of-block sentinel value.
. . .
1x64
0 0 0 0 0 1 1 0 0 0 0 0
5,1
0 0
7,2
0 . . .2
RLEon AC Components
Run-length encode:
โˆ’26, โˆ’3, 0, โˆ’3, โˆ’2, โˆ’6, 2, โˆ’4, 1, โˆ’4, {2 x 1}, 5, 1, 2, โˆ’1, 1, โˆ’1, 2, {5 x
0} , โˆ’1, โˆ’1,
โ€ข Is based on the frequency of occurance of data item(pixel in image).
โ€ข The principle is to use a lower number of bits to encode the data occurs more
frequently.
H(x)= ๐‘–=1
๐‘›
๐ฟ๐‘ƒ๐‘ฅ๐‘–
๐‘ƒ๐‘ฅ๐‘–=log 2 xi
๐ฟ number of bit for each character.
๐‘ƒ๐‘ฅ๐‘– entropy for each character.
Huffman Coding
Example
Symbol Xi sorting Xi Symol Code number ofbit
______ __ ______ _____ _____ ___________
A 0.3 0.3 A 00 2
B 0.2 0.23 C 01 2
C 0.23 0.2 B 11 2
D 0.07 0.15 E 010 3
E 0.15 0.07 D 0110 4
F 0.05 0.05 F 1110 4
H(x)= ๐‘–=1
๐‘›
๐ฟ๐‘ƒ๐‘ฅ๐‘–
=2log 2 0.3 + 2log 2 0.23 + 2log 2 0.2 + 3log 2 0.15 +
4log 2 0.07 + 4log 2 0.05= -0.21
Thank you

More Related Content

What's hot

Video Compression
Video CompressionVideo Compression
Video CompressionShreyash Patel
ย 
Audio file format in computer graphic
Audio file format in computer graphicAudio file format in computer graphic
Audio file format in computer graphicIrfan Khan
ย 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compressionasodariyabhavesh
ย 
Chapter 6 : VIDEO
Chapter 6 : VIDEOChapter 6 : VIDEO
Chapter 6 : VIDEOazira96
ย 
Data compression
Data compressionData compression
Data compressionAbhishek Grover
ย 
Audio compression
Audio compressionAudio compression
Audio compressionMiled Othmen
ย 
Image compression standards
Image compression standardsImage compression standards
Image compression standardskirupasuchi1996
ย 
Multimedia Network
Multimedia NetworkMultimedia Network
Multimedia NetworkMohammed Hussein
ย 
Video compression
Video compressionVideo compression
Video compressionnnmaurya
ย 
Lossless Compression
Lossless CompressionLossless Compression
Lossless CompressionPuchpa Oks
ย 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic codingVikas Goyal
ย 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standardanuragjagetiya
ย 
Audio compression
Audio compressionAudio compression
Audio compressionSahil Garg
ย 
Chapter Eight
Chapter Eight Chapter Eight
Chapter Eight Nada G.Youssef
ย 
data compression technique
data compression techniquedata compression technique
data compression techniqueCHINMOY PAUL
ย 

What's hot (20)

Audio compression
Audio compressionAudio compression
Audio compression
ย 
Video Compression
Video CompressionVideo Compression
Video Compression
ย 
Audio file format in computer graphic
Audio file format in computer graphicAudio file format in computer graphic
Audio file format in computer graphic
ย 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
ย 
Chapter 6 : VIDEO
Chapter 6 : VIDEOChapter 6 : VIDEO
Chapter 6 : VIDEO
ย 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
ย 
Data compression
Data compressionData compression
Data compression
ย 
Audio compression
Audio compressionAudio compression
Audio compression
ย 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
ย 
Multimedia Network
Multimedia NetworkMultimedia Network
Multimedia Network
ย 
Video compression
Video compressionVideo compression
Video compression
ย 
Lossless Compression
Lossless CompressionLossless Compression
Lossless Compression
ย 
JPEG
JPEGJPEG
JPEG
ย 
Arithmetic coding
Arithmetic codingArithmetic coding
Arithmetic coding
ย 
MPEG video compression standard
MPEG video compression standardMPEG video compression standard
MPEG video compression standard
ย 
Data compression
Data compressionData compression
Data compression
ย 
Audio compression
Audio compressionAudio compression
Audio compression
ย 
Chapter Eight
Chapter Eight Chapter Eight
Chapter Eight
ย 
Jpeg
JpegJpeg
Jpeg
ย 
data compression technique
data compression techniquedata compression technique
data compression technique
ย 

Similar to lossy compression JPEG

CyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdfCyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdfMohammadAzreeYahaya
ย 
Video Compression Basics
Video Compression BasicsVideo Compression Basics
Video Compression BasicsSanjiv Malik
ย 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standardsMazin Alwaaly
ย 
Mmclass4
Mmclass4Mmclass4
Mmclass4Hassan Dar
ย 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image CompressionAishwarya K. M.
ย 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.pptHarisMasood20
ย 
introduction to jpeg for image proce.ppt
introduction to jpeg for image proce.pptintroduction to jpeg for image proce.ppt
introduction to jpeg for image proce.pptnaghamallella
ย 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesZakaria Zubi
ย 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image CompressionMathankumar S
ย 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compressionZaabir Ali
ย 
MPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video EncodingMPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video EncodingChristian Kehl
ย 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?Prabhat Kumar
ย 
Source coding
Source codingSource coding
Source codingMOHIT KUMAR
ย 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compressionmurugan hari
ย 
Video Compression Basics by sahil jain
Video Compression Basics by sahil jainVideo Compression Basics by sahil jain
Video Compression Basics by sahil jainSahil Jain
ย 
Steganography Part 2
Steganography Part 2Steganography Part 2
Steganography Part 2Heethesh Vhavle
ย 
DC04 Image Compression Standards.pdf
DC04 Image Compression Standards.pdfDC04 Image Compression Standards.pdf
DC04 Image Compression Standards.pdfssuser1bd081
ย 

Similar to lossy compression JPEG (20)

Data compression
Data compressionData compression
Data compression
ย 
CyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdfCyberSec_JPEGcompressionForensics.pdf
CyberSec_JPEGcompressionForensics.pdf
ย 
Video Compression Basics
Video Compression BasicsVideo Compression Basics
Video Compression Basics
ย 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
ย 
Mmclass4
Mmclass4Mmclass4
Mmclass4
ย 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
ย 
notes_Image Compression_edited.ppt
notes_Image Compression_edited.pptnotes_Image Compression_edited.ppt
notes_Image Compression_edited.ppt
ย 
introduction to jpeg for image proce.ppt
introduction to jpeg for image proce.pptintroduction to jpeg for image proce.ppt
introduction to jpeg for image proce.ppt
ย 
Ibtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital imagesIbtc dwt hybrid coding of digital images
Ibtc dwt hybrid coding of digital images
ย 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
ย 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
ย 
MPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video EncodingMPEG-1 Part 2 Video Encoding
MPEG-1 Part 2 Video Encoding
ย 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?
ย 
Source coding
Source codingSource coding
Source coding
ย 
Ch7 031102
Ch7 031102Ch7 031102
Ch7 031102
ย 
image basics and image compression
image basics and image compressionimage basics and image compression
image basics and image compression
ย 
Video Compression Basics by sahil jain
Video Compression Basics by sahil jainVideo Compression Basics by sahil jain
Video Compression Basics by sahil jain
ย 
Steganography Part 2
Steganography Part 2Steganography Part 2
Steganography Part 2
ย 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
ย 
DC04 Image Compression Standards.pdf
DC04 Image Compression Standards.pdfDC04 Image Compression Standards.pdf
DC04 Image Compression Standards.pdf
ย 

Recently uploaded

Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Call Girls in Nagpur High Profile
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Standamitlee9823
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
ย 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
ย 

Recently uploaded (20)

Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
ย 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
ย 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
ย 

lossy compression JPEG

  • 1. Lossy Compression By: Mahmoud Hikmet Bzhar Omer Supervisor: Dr.Roojwan Sdiq
  • 2. Overview โ€ข What's Comparession ? โ€ข Whatโ€™s lossless and lossy compression ? โ€ข Whatโ€™s JPEG? โ€ข The Major Steps in JPEG Coding involve: ๏ƒผ Transform RGB to YIQ or YUV and subsample color. ๏ƒผ DCT(Discrete Cosine Transformation). ๏ƒผ Quantization. ๏ƒผ Zig-zag ordering ๏ƒผ DPCM on DC component ๏ƒผ Run-length encoding. ๏ƒผ Entropy coding.
  • 3. What is Comparession ? โ€ข Compression is the reduction in size of data in order to save space or transmission time. Learn how files are compressed .
  • 4. Whatโ€™s lossless and lossy compression ? โ€ข Lossless: The compression of a file, all original data can be recovered when the file is uncompressed. โ€ข Lossy : -The compressed data is not the same as the original data, but a close approximation of it.
  • 5. What is JPEG? โ€ข "Joint Photographic Expert Group" -- an international standard in 1992. โ€ข Works with colour and greyscale images, Many applications e.g., satellite, medical, ..
  • 6. JPEG compression involves the following:
  • 7. DCT : Discrete Cosine Transform โ€ข DCT converts the information contained in a block(8x8) of pixels from spatial domain to the frequency domain. 1-D DCT: 1-D Inverese DCT: ๏ƒฅ ๏€ญ ๏€ฝ ๏€ซ ๏€ฝ 1N 0n 2N 1)(2n f(n)cos 2 a(u))F( ๏ท๏ฐ ๏ท ๏ƒฅ ๏€ญ ๏€ฝ ๏€ซ ๏€ฝ 1N 0 2N 1)(2n )cosF( 2 a(u))(fโ€™ ๏ท ๏ท๏ฐ ๏ทn ๏› ๏0p1a(p) 2 1a(0) ๏‚น๏€ฝ ๏€ฝ
  • 8. Examplesubimage2*2 154 123 192 186 D Subtract 128 from each value to convert to signed 26 -5 64 58 D First Row= 2 1 secondRow= 2N 1)(2n cos ๏ท๏ฐ๏€ซ N/2
  • 9. 1- = 0.7071 2- 2 1 N*2 1)(2n cos ๏ท๏ฐ๏€ซ N/2 D(1,0)= 2*2 *1)0*(2 cos ๏ฐ1๏€ซ 2/2 D(1,0)= 4 cos ๏ฐ D(1,0)=0.7071 D(1,1)= 2*2 *1)1*(2 cos ๏ฐ1๏€ซ 2/2 D(1,1)= 4 cos ๏ฐ3 D(1,1)=-0.7071 0.7071 0.7071 0.7071 -0.7071 T
  • 10. 0.7071 0.7071 0.7071 -0.7071 0.7071 0.7071 0.7071 -0.7071 26 -5 64 58* * T D -T 63.639 33.234 -26.87 -40.305 0.7071 0.7071 0.7071 -0.7071* 68.5 21.5 -47.5 9.5DCT=
  • 11. Quantization: โ€ข The quantization step is the main source for loss in JPEG compression โ€ข Encoder: Each value in the current block is divided by 16 and rounded down to create the quantised block. โ€ข Round(DCT/Q) 68.5 21.5 -47.5 9.5 16 11 12 12 Q 4 2 -4 1 4 2 -4 1 QDCT
  • 12. Quantization: โ€ข The quantization step is the main source for loss in JPEG compression. โ€ข Decoder: Each value in the quantised block is multiplied by quntize block. 4 2 -4 1 QDCT 16 11 12 12* 64 22 -48 12 Q-1
  • 13. โ€ข DCT-1=round(T*Q-1*T)+128 DCT-inverse 0.7071 0.7071 0.7071 -0.7071 0.7071 0.7071 0.7071 -0.7071 26 -5 64 58 T Q-1 -T * * 11.314 24.041 79.195 7.071 * 0.7071 0.7071 0.7071 -0.7071 = = = 25 -9 61 51 + 128 128 128 128 153 119 189 179 =
  • 14. 154 123 192 186 D - 153 119 189 179 DCT-1 1 4 3 7 =
  • 15. Zig-Zag Scan โ€ข Why? to group low frequency coefficients in top of vector and high frequency coefficients at the bottom โˆ’26, โˆ’3, 0, โˆ’3, โˆ’2, โˆ’6, 2, โˆ’4, 1, โˆ’4, 1, 1, 5, 1, 2, โˆ’1, 1, โˆ’1, 2, 0, 0, 0, 0, 0, โˆ’1, โˆ’1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, EOB
  • 16. โ€ข The 1x64 vectors have a lot of zeros in them, more so towards the end of the vector. โ€ข Higher up entries in the vector capture higher frequency (DCT) components which tend to be capture less of the content. โ€ข Could have been as a result of using a quantization table โ€ข Encode a series of 0s as a (skip,value) pair, where skip is the number of zeros and value is the next non-zero component. โ€ข Send (0,0) as end-of-block sentinel value. . . . 1x64 0 0 0 0 0 1 1 0 0 0 0 0 5,1 0 0 7,2 0 . . .2 RLEon AC Components Run-length encode: โˆ’26, โˆ’3, 0, โˆ’3, โˆ’2, โˆ’6, 2, โˆ’4, 1, โˆ’4, {2 x 1}, 5, 1, 2, โˆ’1, 1, โˆ’1, 2, {5 x 0} , โˆ’1, โˆ’1,
  • 17. โ€ข Is based on the frequency of occurance of data item(pixel in image). โ€ข The principle is to use a lower number of bits to encode the data occurs more frequently. H(x)= ๐‘–=1 ๐‘› ๐ฟ๐‘ƒ๐‘ฅ๐‘– ๐‘ƒ๐‘ฅ๐‘–=log 2 xi ๐ฟ number of bit for each character. ๐‘ƒ๐‘ฅ๐‘– entropy for each character. Huffman Coding
  • 18. Example Symbol Xi sorting Xi Symol Code number ofbit ______ __ ______ _____ _____ ___________ A 0.3 0.3 A 00 2 B 0.2 0.23 C 01 2 C 0.23 0.2 B 11 2 D 0.07 0.15 E 010 3 E 0.15 0.07 D 0110 4 F 0.05 0.05 F 1110 4 H(x)= ๐‘–=1 ๐‘› ๐ฟ๐‘ƒ๐‘ฅ๐‘– =2log 2 0.3 + 2log 2 0.23 + 2log 2 0.2 + 3log 2 0.15 + 4log 2 0.07 + 4log 2 0.05= -0.21