SlideShare a Scribd company logo
1 of 26
JPEG
Nagham ALLayla & Asmaa ALQassab
Supervised by
Dr. Khalil ALSaif
What is JPEG?
 JPEG is sophisticated lossy/lossless
compression method for color or greyscale
still images. It works best on continuous tone
images where adjacent pixels have similar
colors. One advantage of JPEG is the use of
many parameters, allowing the use to adjust
the amount of data lost over a wide variety
range.
Main Goals of JPEG
 High Compression Ratio in such cases where
images quality is judged as very good to
excellent.
 The use of many parameters allowing user to
experiment and achieve the desired level of
compression.
 Obtaining good results any kind of continuous
tone images.
 Sophisticated but not too complex compression
method, allowing software and hardware
implementation on many platform.
 Several modes of operations.
Modes of JPEG
 Sequential Mode: each image component is
compressed in a single left to right, top to bottom
scan.
 Progressive Mode: the images is compressed in
multiple blocks to be viewed from coarse to final
detail.
 Lossless Mode: important for cases where the
user decides no pixel should be lost.
 Hierarchical Mode: the image is compressed at
multiple resolution allowing lower resolution blocks
to be viewed without first having to decompressed
the following higher-resolution blocks.
Basic JPEG Compression
 JPEG compression involves the following:
 Color Space Transform and subsampling (YIQ)
 DCT (Discrete Cosine Transformation)
 Quantization
 Zigzag Scan
 DPCM on DC component & RLE on AC Components
 Entropy Coding — Huffman or Arithmetic
JPEG Encoding
1.Colour Space Transform and sub-sampling(YIQ)
 The images values are transformed from RGB to
luminance/chrominance color space.
 The eye is sensitive to small changes in luminance
but not in chrominance. So chrominance values
can be used to compress the data.
 This step is optional but important since the
remainder of the algorithm works on each color
component separately.
Color Space Transformation
 RGB to YCbCr
 Y is Luminance (Brightness).
 CbCr is the Chrominance.
 Sampling:
RGB
RGB
Y
Cb Cr
+ (Down Sampling)
RGB to YCbCr
 First the image is divided into 8x8 blocks.
RGB RGB
RGB RGB
Y Y
Y Y
Cb
Cr
+
8
8
8 8
8
8
8 8
8
8
8
4 x 64 x 3 byte 4 x 64 x 1 byte 2 x 64 x 1 byte
Y = 0.299 R + 0.587 G + 0.114 B
Cb = - 0.169 R - 0.331 G + 0.500 B
Cr = 0.500 R - 0.419 G - 0.081 B
The mathematical representation of FDCT (2-D):

 



7
0
7
0
)
16
/
)
1
(
2
cos(
)
16
/
)
1
(
2
cos(
)
,
(
)
(
)
(
4
1
)
,
(
x y
v
j
u
i
y
x
f
v
C
u
C
v
u
F 

Where


 

otherwise
x
x
C
1
0
2
/
1
)
(
f(x,y): 2-D sample value
F(u,v): 2-D DCT coefficient
2.Discrete Cosine Transform (DCT)
 The Discrete Cosine Transform (DCT) separates the frequencies
contained in an image.
 The original data could be reconstructed by Inverse DCT.
DCT (cont’d)
DCT
Coefficients
sxy DCT
8
8 8
8
DC coefficient
 The DCT coefficient values can be regarded as the
relative amounts of the 2-D spatial frequencies
contained in the 88 block
 the upper-left corner coefficient is called the DC
coefficient, which is a measure of the average of
the energy of the block
 Other coefficients are called AC coefficients,
coefficients correspond to high frequencies tend to
be zero or near zero for most natural images
DCT (cont’d)
 Why we apply DCT?
 To move from Spatial Domain to Frequency
Domain.
 Why not FFT?
 DCT is like FFT, but can approximate linear
signals well with few [real] coefficients.
 DCT is slow
 1024 multiplications and 896 additions.
 JPEG 2000: Wavelet Transforms.
3.Quantization
)
)
,
(
)
,
(
(
)
,
(
'
v
u
Q
v
u
F
Round
v
u
F 
F(u,v): original DCT coefficient
F’(u,v): DCT coefficient after quantization
Q(u,v): quantization value
Quantization (cont’d)
 Why do we need to quantise:
 To throw out bits from DCT.
Example: 101101 = 45 (6 bits).
Truncate to 4 bits: 1011 = 11.
Truncate to 3 bits: 101 = 5.
 Quantization error is the main source of Lossy
Compression.
 • DCT itself is not Lossy
 • How we throw away bits in Quantization
Step is Lossy
Quantization (Example)
F(u,v)
8x8 DCT coefficiences
16 11 10 16 24 40 51 61
12 12 14 19 26 58 60 55
14 13 16 24 40 57 69 56
14 17 22 29 51 87 80 62
18 22 37 56 68 109 103 77
24 35 55 64 81 104 113 92
49 64 78 87 103 121 120 101
72 92 95 98 112 100 103 99
Q(u,v)
Quantization matrix
699.25 43.18 55.25 72.11 24.00 -25.51 11.21 -4.14
-129.78 -71.50 -70.26 -73.35 59.43 -24.02 22.61 -2.05
85.71 30.32 61.78 44.87 14.84 17.35 15.51 -13.19
-40.81 10.17 -17.53 -55.81 30.50 -2.28 -21.00 -1.26
-157.50 -49.39 13.27 -1.78 -8.75 22.47 -8.47 -9.23
92.49 -9.03 45.72 -48.13 -58.51 -9.01 -28.54 10.38
-53.09 -62.97 -3.49 -19.62 56.09 -2.25 -3.28 11.91
-20.54 -55.90 -20.59 -18.19 -26.58 -27.07 8.47 0.31
Quantization (Example)
43.70 3.93 5.52 4.51 1.00 -0.64 0.22 -0.07
-10.82 -5.96 -5.02 -3.86 2.29 -0.41 0.38 -0.04
6.12 2.33 3.86 1.87 0.37 0.30 0.22 -0.24
-2.91 0.60 -0.80 -1.92 0.60 -0.03 -0.26 -0.02
-8.75 -2.25 0.36 -0.03 -0.13 0.21 -0.08 -0.12
3.85 -0.26 0.83 -0.75 -0.72 -0.09 -0.25 0.11
-1.08 -0.98 -0.04 -0.23 0.54 -0.02 -0.03 0.12
-0.29 -0.61 -0.22 -0.19 -0.24 -0.27 0.08 0.00
( , )
( , )
F u v
Q u v
44 4 6 5 1 -1 0 0
-11 -6 -5 -4 2 0 0 0
6 2 4 2 0 0 0 0
-3 1 -1 -2 1 0 0 0
-9 -2 0 0 0 0 0 0
4 0 1 -1 -1 0 0 0
-1 -1 0 0 1 0 0 0
0 -1 0 0 0 0 0 0
( , )
( , )
( , )
q
F u v
F u v
Round
Q u v

 
 
 
4.Zig Zag Scan
 8x8 Blocks to a 1x64
Vector.
 Why Zig Zag Scan?
 To sort 8x8 DCT
coefficients based on
the spatial frequencies
(low frequency
coefficients in top of
vector).
0 1 2 . . . 63
DC Component
(No Frequency)
Highest Frequency
1x64 Vector:
0 1 5 6 14 15 27 28
2 4 7 13 16 26 29 42
3 8 12 17 25 30 41 43
9 11 18 24 31 40 44 53
10 19 23 32 39 45 52 54
20 22 33 38 46 51 55 60
21 34 37 47 50 56 59 61
35 36 49 48 57 58 62 63
Horizontal frequency
Vertical
frequency
Zig-Zag Reordering (Example)
44 4 6 5 1 -1 0 0
-11 -6 -5 -4 2 0 0 0
6 2 4 2 0 0 0 0
-3 1 -1 -2 1 0 0 0
-9 -2 0 0 0 0 0 0
4 0 1 -1 -1 0 0 0
-1 -1 0 0 1 0 0 0
0 -1 0 0 0 0 0 0
( , )
q
F u v
Zig-Zag Reordering :
44,
4,-11,
6,-6,6,
5,-5,2,-3,
-9,1,4,-4,1,
-1,2,2,-1,-2,4,
-1,0,0,-2,0,0,0,
0,0,0,1,0,1,-1,0,
-1,0,-1,0,0,0,0,
0,0,0,-1,0,0,
0,1,0,0,0,
0,0,0,0,
0,0,0,
0,0,
0
5.DPCM & RLE
1. DPCM on DC Component
 Differential Pulse Code Modulation.
 DC component is large and varied, but often
close to previous value.
2. RLE on AC Components
 Zero Run Length Encoding.
 1 x 64 vector has lots of zeros in it.
 57,45,0,0,0,0,23,0,-30,-16,0,0,1,0,0,0, 0 , 0 ,0 , only 0,..,0
RLC: (0,57); (0,45); (4,23); (1,-30); (0,-16); (2,1); EOB
EOB = (0,0)
Differential Pulse Code Modulation(DPCM) on DC
Component
DCi1 DCi
…
…
DC1
DC0
0
…
…
Encode :
Diffi = DCi  DCi1
Decode :
DCi = DCi1 + Diffi
DCs of 88 blocks
block 1 block i1 block i
Diff1=DC1
Diffi1=
DCi1 DCi2
Diffi=
DCi DCi1
6.Huffman (Entropy) Coding
 DC and AC components finally need to be
represented by a
 smaller number of bits (Arithmetic coding also
supported in place of Huffman coding):
 (Variant of) Huffman coding: Each DPCM-coded DC
coefficient is represented by a pair of symbols : (Size,
Amplitude) where Size indicates number of bits needed
to represent coefficient and Amplitude contains actual
bits.
Huffman Coding (Table of values and bits for the
values)
Category Values Bits for the value
1 -1,1 0,1
2 -3,-2,2,3 00,01,10,11
3 -7,-6,-5,-4,4,5,6,7 000,001,010,011,100,101,110,111
4 -15,...,-8,8,...,15 0000,...,0111,1000,...,1111
5 -31,...,-16,16,...31 00000,...,01111,10000,...,11111
6 -63,...,-32,32,...63 000000,...,011111,100000,...,111111
7 -127,...,-64,64,...,127 0000000,...,0111111,1000000,...,1111111
8 -255,..,-128,128,..,255 ...
9 -511,..,-256,256,..,511 ...
10 -1023,..,-512,512,..,1023 ...
11 -2047,..,-1024,1024,..,2047 ...
Huffman Coding (Huffman table of luminance AC
coefficience)
run/category code length code word
0/0 4 1010
...
0/6 7 1111000
...
0/10 16 1111111110000011
1/1 4 1100
...
1/5 11 11111110110
...
4/5 16 1111111110011000
...
15/10 16 1111111111111110
Huffman Coding (Huffman table of luminance DC
coefficience)
category code length code word
0 2 00
1 3 010
2 3 011
3 3 100
4 3 101
5 3 110
6 4 1110
7 5 11110
8 6 111110
9 7 1111110
10 8 11111110
11 9 111111110
Huffman Coding (Example)
Run length coding of 63 AC coefficiences :
(0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-8) ; (2,1) ; (0,0)
Encode the right value of these pair as category and bits for the value,
except the special markers like (0,0) or (15,0) :
(0,6,111001) ; (0,6,101101) ; (4,5,10111);
(1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0)
The difference of DC coefficience :
-511
Encode the value as category and bits for the value :
9, 000000000
Huffman Coding (Example) (cont’d)
The AC coefficiences :
(0,6,111001) ; (0,6,101101) ; (4,5,10111);
(1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0)
Encode the left two value in () using Huffman encoding :
1111000 111001 , 1111000 101101 , 1111111110011000 10111 ,
11111110110 00001 , 1011 0111 , 11100 1 , 1010
The DC coefficience :
9, 000000000
Encode the category using Huffman encoding :
1111110 000000000

More Related Content

Similar to jpg image processing nagham salim_as.ppt

Comparing Machine Learning Algorithms in Text Mining
Comparing Machine Learning Algorithms in Text MiningComparing Machine Learning Algorithms in Text Mining
Comparing Machine Learning Algorithms in Text MiningAndrea Gigli
 
lossy compression JPEG
lossy compression JPEGlossy compression JPEG
lossy compression JPEGMahmoud Hikmet
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compressionZaabir Ali
 
Efficient Implementation of Self-Organizing Map for Sparse Input Data
Efficient Implementation of Self-Organizing Map for Sparse Input DataEfficient Implementation of Self-Organizing Map for Sparse Input Data
Efficient Implementation of Self-Organizing Map for Sparse Input Dataymelka
 
An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)Julien SIMON
 
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
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplifiedLovelyn Rose
 
IJEST12-04-09-150
IJEST12-04-09-150IJEST12-04-09-150
IJEST12-04-09-150Jigar Jain
 
Blur Filter - Hanpo
Blur Filter - HanpoBlur Filter - Hanpo
Blur Filter - HanpoHanpo Cheng
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standardsMazin Alwaaly
 
추천시스템 이제는 돈이 되어야 한다.
추천시스템 이제는 돈이 되어야 한다.추천시스템 이제는 돈이 되어야 한다.
추천시스템 이제는 돈이 되어야 한다.choi kyumin
 
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIX
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIXSQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIX
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIXijcsit
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Usatyuk Vasiliy
 

Similar to jpg image processing nagham salim_as.ppt (20)

Comparing Machine Learning Algorithms in Text Mining
Comparing Machine Learning Algorithms in Text MiningComparing Machine Learning Algorithms in Text Mining
Comparing Machine Learning Algorithms in Text Mining
 
Image compression
Image compressionImage compression
Image compression
 
lossy compression JPEG
lossy compression JPEGlossy compression JPEG
lossy compression JPEG
 
image compression in data compression
image compression in data compressionimage compression in data compression
image compression in data compression
 
Efficient Implementation of Self-Organizing Map for Sparse Input Data
Efficient Implementation of Self-Organizing Map for Sparse Input DataEfficient Implementation of Self-Organizing Map for Sparse Input Data
Efficient Implementation of Self-Organizing Map for Sparse Input Data
 
An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)An introduction to Deep Learning with Apache MXNet (November 2017)
An introduction to Deep Learning with Apache MXNet (November 2017)
 
Image Compression
Image CompressionImage Compression
Image Compression
 
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
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplified
 
JPEG
JPEGJPEG
JPEG
 
IJEST12-04-09-150
IJEST12-04-09-150IJEST12-04-09-150
IJEST12-04-09-150
 
Blur Filter - Hanpo
Blur Filter - HanpoBlur Filter - Hanpo
Blur Filter - Hanpo
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Final Project
Final ProjectFinal Project
Final Project
 
추천시스템 이제는 돈이 되어야 한다.
추천시스템 이제는 돈이 되어야 한다.추천시스템 이제는 돈이 되어야 한다.
추천시스템 이제는 돈이 되어야 한다.
 
Squashed JPEG Image Compression via Sparse Matrix
Squashed JPEG Image Compression via Sparse MatrixSquashed JPEG Image Compression via Sparse Matrix
Squashed JPEG Image Compression via Sparse Matrix
 
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIX
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIXSQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIX
SQUASHED JPEG IMAGE COMPRESSION VIA SPARSE MATRIX
 
Squashed JPEG Image Compression via Sparse Matrix
Squashed JPEG Image Compression via Sparse MatrixSquashed JPEG Image Compression via Sparse Matrix
Squashed JPEG Image Compression via Sparse Matrix
 
Deep Learning
Deep LearningDeep Learning
Deep Learning
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...
 

More from naghamallella

OS-20210426203801 introduction to os.ppt
OS-20210426203801 introduction to os.pptOS-20210426203801 introduction to os.ppt
OS-20210426203801 introduction to os.pptnaghamallella
 
basic logic gate presentation date23.ppt
basic logic gate presentation date23.pptbasic logic gate presentation date23.ppt
basic logic gate presentation date23.pptnaghamallella
 
logic gate presentation for and or n.ppt
logic gate presentation for and or n.pptlogic gate presentation for and or n.ppt
logic gate presentation for and or n.pptnaghamallella
 
6_2019_04_09!08_59_48_PM logic gate_.ppt
6_2019_04_09!08_59_48_PM logic gate_.ppt6_2019_04_09!08_59_48_PM logic gate_.ppt
6_2019_04_09!08_59_48_PM logic gate_.pptnaghamallella
 
bin packing 2 for real time scheduli.ppt
bin packing 2 for real time scheduli.pptbin packing 2 for real time scheduli.ppt
bin packing 2 for real time scheduli.pptnaghamallella
 
bin packing2 and scheduling for mul.pptx
bin packing2 and scheduling for mul.pptxbin packing2 and scheduling for mul.pptx
bin packing2 and scheduling for mul.pptxnaghamallella
 
BOOTP computer science for multiproc.ppt
BOOTP computer science for multiproc.pptBOOTP computer science for multiproc.ppt
BOOTP computer science for multiproc.pptnaghamallella
 
trusted computing platform alliancee.ppt
trusted computing platform alliancee.ppttrusted computing platform alliancee.ppt
trusted computing platform alliancee.pptnaghamallella
 
trusted computing for security confe.ppt
trusted computing for security confe.ppttrusted computing for security confe.ppt
trusted computing for security confe.pptnaghamallella
 
bin packing and scheduling multiproc.ppt
bin packing and scheduling multiproc.pptbin packing and scheduling multiproc.ppt
bin packing and scheduling multiproc.pptnaghamallella
 
multiprocessor _system _presentation.ppt
multiprocessor _system _presentation.pptmultiprocessor _system _presentation.ppt
multiprocessor _system _presentation.pptnaghamallella
 
image processing for jpeg presentati.ppt
image processing for jpeg presentati.pptimage processing for jpeg presentati.ppt
image processing for jpeg presentati.pptnaghamallella
 
lips _reading_nagham _salim compute.pptx
lips _reading_nagham _salim compute.pptxlips _reading_nagham _salim compute.pptx
lips _reading_nagham _salim compute.pptxnaghamallella
 
electronic mail security for authent.ppt
electronic mail security for authent.pptelectronic mail security for authent.ppt
electronic mail security for authent.pptnaghamallella
 
web _security_ for _confedindality s.ppt
web _security_ for _confedindality s.pptweb _security_ for _confedindality s.ppt
web _security_ for _confedindality s.pptnaghamallella
 
lips _reading _in computer_ vision_n.ppt
lips _reading _in computer_ vision_n.pptlips _reading _in computer_ vision_n.ppt
lips _reading _in computer_ vision_n.pptnaghamallella
 
thread_ multiprocessor_ scheduling_a.ppt
thread_ multiprocessor_ scheduling_a.pptthread_ multiprocessor_ scheduling_a.ppt
thread_ multiprocessor_ scheduling_a.pptnaghamallella
 
distributed real time system schedul.ppt
distributed real time system schedul.pptdistributed real time system schedul.ppt
distributed real time system schedul.pptnaghamallella
 
Trusted Computing security _platform.ppt
Trusted Computing security _platform.pptTrusted Computing security _platform.ppt
Trusted Computing security _platform.pptnaghamallella
 
Trusted Computing _plate form_ model.ppt
Trusted Computing _plate form_ model.pptTrusted Computing _plate form_ model.ppt
Trusted Computing _plate form_ model.pptnaghamallella
 

More from naghamallella (20)

OS-20210426203801 introduction to os.ppt
OS-20210426203801 introduction to os.pptOS-20210426203801 introduction to os.ppt
OS-20210426203801 introduction to os.ppt
 
basic logic gate presentation date23.ppt
basic logic gate presentation date23.pptbasic logic gate presentation date23.ppt
basic logic gate presentation date23.ppt
 
logic gate presentation for and or n.ppt
logic gate presentation for and or n.pptlogic gate presentation for and or n.ppt
logic gate presentation for and or n.ppt
 
6_2019_04_09!08_59_48_PM logic gate_.ppt
6_2019_04_09!08_59_48_PM logic gate_.ppt6_2019_04_09!08_59_48_PM logic gate_.ppt
6_2019_04_09!08_59_48_PM logic gate_.ppt
 
bin packing 2 for real time scheduli.ppt
bin packing 2 for real time scheduli.pptbin packing 2 for real time scheduli.ppt
bin packing 2 for real time scheduli.ppt
 
bin packing2 and scheduling for mul.pptx
bin packing2 and scheduling for mul.pptxbin packing2 and scheduling for mul.pptx
bin packing2 and scheduling for mul.pptx
 
BOOTP computer science for multiproc.ppt
BOOTP computer science for multiproc.pptBOOTP computer science for multiproc.ppt
BOOTP computer science for multiproc.ppt
 
trusted computing platform alliancee.ppt
trusted computing platform alliancee.ppttrusted computing platform alliancee.ppt
trusted computing platform alliancee.ppt
 
trusted computing for security confe.ppt
trusted computing for security confe.ppttrusted computing for security confe.ppt
trusted computing for security confe.ppt
 
bin packing and scheduling multiproc.ppt
bin packing and scheduling multiproc.pptbin packing and scheduling multiproc.ppt
bin packing and scheduling multiproc.ppt
 
multiprocessor _system _presentation.ppt
multiprocessor _system _presentation.pptmultiprocessor _system _presentation.ppt
multiprocessor _system _presentation.ppt
 
image processing for jpeg presentati.ppt
image processing for jpeg presentati.pptimage processing for jpeg presentati.ppt
image processing for jpeg presentati.ppt
 
lips _reading_nagham _salim compute.pptx
lips _reading_nagham _salim compute.pptxlips _reading_nagham _salim compute.pptx
lips _reading_nagham _salim compute.pptx
 
electronic mail security for authent.ppt
electronic mail security for authent.pptelectronic mail security for authent.ppt
electronic mail security for authent.ppt
 
web _security_ for _confedindality s.ppt
web _security_ for _confedindality s.pptweb _security_ for _confedindality s.ppt
web _security_ for _confedindality s.ppt
 
lips _reading _in computer_ vision_n.ppt
lips _reading _in computer_ vision_n.pptlips _reading _in computer_ vision_n.ppt
lips _reading _in computer_ vision_n.ppt
 
thread_ multiprocessor_ scheduling_a.ppt
thread_ multiprocessor_ scheduling_a.pptthread_ multiprocessor_ scheduling_a.ppt
thread_ multiprocessor_ scheduling_a.ppt
 
distributed real time system schedul.ppt
distributed real time system schedul.pptdistributed real time system schedul.ppt
distributed real time system schedul.ppt
 
Trusted Computing security _platform.ppt
Trusted Computing security _platform.pptTrusted Computing security _platform.ppt
Trusted Computing security _platform.ppt
 
Trusted Computing _plate form_ model.ppt
Trusted Computing _plate form_ model.pptTrusted Computing _plate form_ model.ppt
Trusted Computing _plate form_ model.ppt
 

Recently uploaded

Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024AyushiRastogi48
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptArshadWarsi13
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfSwapnil Therkar
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxFarihaAbdulRasheed
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naJASISJULIANOELYNV
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxEran Akiva Sinbar
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsHajira Mahmood
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555kikilily0909
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 

Recently uploaded (20)

Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024Vision and reflection on Mining Software Repositories research in 2024
Vision and reflection on Mining Software Repositories research in 2024
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.ppt
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptxRESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
RESPIRATORY ADAPTATIONS TO HYPOXIA IN HUMNAS.pptx
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
FREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by naFREE NURSING BUNDLE FOR NURSES.PDF by na
FREE NURSING BUNDLE FOR NURSES.PDF by na
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutions
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 

jpg image processing nagham salim_as.ppt

  • 1. JPEG Nagham ALLayla & Asmaa ALQassab Supervised by Dr. Khalil ALSaif
  • 2. What is JPEG?  JPEG is sophisticated lossy/lossless compression method for color or greyscale still images. It works best on continuous tone images where adjacent pixels have similar colors. One advantage of JPEG is the use of many parameters, allowing the use to adjust the amount of data lost over a wide variety range.
  • 3. Main Goals of JPEG  High Compression Ratio in such cases where images quality is judged as very good to excellent.  The use of many parameters allowing user to experiment and achieve the desired level of compression.  Obtaining good results any kind of continuous tone images.  Sophisticated but not too complex compression method, allowing software and hardware implementation on many platform.  Several modes of operations.
  • 4. Modes of JPEG  Sequential Mode: each image component is compressed in a single left to right, top to bottom scan.  Progressive Mode: the images is compressed in multiple blocks to be viewed from coarse to final detail.  Lossless Mode: important for cases where the user decides no pixel should be lost.  Hierarchical Mode: the image is compressed at multiple resolution allowing lower resolution blocks to be viewed without first having to decompressed the following higher-resolution blocks.
  • 5. Basic JPEG Compression  JPEG compression involves the following:  Color Space Transform and subsampling (YIQ)  DCT (Discrete Cosine Transformation)  Quantization  Zigzag Scan  DPCM on DC component & RLE on AC Components  Entropy Coding — Huffman or Arithmetic
  • 7. 1.Colour Space Transform and sub-sampling(YIQ)  The images values are transformed from RGB to luminance/chrominance color space.  The eye is sensitive to small changes in luminance but not in chrominance. So chrominance values can be used to compress the data.  This step is optional but important since the remainder of the algorithm works on each color component separately.
  • 8. Color Space Transformation  RGB to YCbCr  Y is Luminance (Brightness).  CbCr is the Chrominance.  Sampling: RGB RGB Y Cb Cr + (Down Sampling)
  • 9. RGB to YCbCr  First the image is divided into 8x8 blocks. RGB RGB RGB RGB Y Y Y Y Cb Cr + 8 8 8 8 8 8 8 8 8 8 8 4 x 64 x 3 byte 4 x 64 x 1 byte 2 x 64 x 1 byte Y = 0.299 R + 0.587 G + 0.114 B Cb = - 0.169 R - 0.331 G + 0.500 B Cr = 0.500 R - 0.419 G - 0.081 B
  • 10. The mathematical representation of FDCT (2-D):       7 0 7 0 ) 16 / ) 1 ( 2 cos( ) 16 / ) 1 ( 2 cos( ) , ( ) ( ) ( 4 1 ) , ( x y v j u i y x f v C u C v u F   Where      otherwise x x C 1 0 2 / 1 ) ( f(x,y): 2-D sample value F(u,v): 2-D DCT coefficient 2.Discrete Cosine Transform (DCT)  The Discrete Cosine Transform (DCT) separates the frequencies contained in an image.  The original data could be reconstructed by Inverse DCT.
  • 11. DCT (cont’d) DCT Coefficients sxy DCT 8 8 8 8 DC coefficient  The DCT coefficient values can be regarded as the relative amounts of the 2-D spatial frequencies contained in the 88 block  the upper-left corner coefficient is called the DC coefficient, which is a measure of the average of the energy of the block  Other coefficients are called AC coefficients, coefficients correspond to high frequencies tend to be zero or near zero for most natural images
  • 12. DCT (cont’d)  Why we apply DCT?  To move from Spatial Domain to Frequency Domain.  Why not FFT?  DCT is like FFT, but can approximate linear signals well with few [real] coefficients.  DCT is slow  1024 multiplications and 896 additions.  JPEG 2000: Wavelet Transforms.
  • 13. 3.Quantization ) ) , ( ) , ( ( ) , ( ' v u Q v u F Round v u F  F(u,v): original DCT coefficient F’(u,v): DCT coefficient after quantization Q(u,v): quantization value
  • 14. Quantization (cont’d)  Why do we need to quantise:  To throw out bits from DCT. Example: 101101 = 45 (6 bits). Truncate to 4 bits: 1011 = 11. Truncate to 3 bits: 101 = 5.  Quantization error is the main source of Lossy Compression.  • DCT itself is not Lossy  • How we throw away bits in Quantization Step is Lossy
  • 15. Quantization (Example) F(u,v) 8x8 DCT coefficiences 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 Q(u,v) Quantization matrix 699.25 43.18 55.25 72.11 24.00 -25.51 11.21 -4.14 -129.78 -71.50 -70.26 -73.35 59.43 -24.02 22.61 -2.05 85.71 30.32 61.78 44.87 14.84 17.35 15.51 -13.19 -40.81 10.17 -17.53 -55.81 30.50 -2.28 -21.00 -1.26 -157.50 -49.39 13.27 -1.78 -8.75 22.47 -8.47 -9.23 92.49 -9.03 45.72 -48.13 -58.51 -9.01 -28.54 10.38 -53.09 -62.97 -3.49 -19.62 56.09 -2.25 -3.28 11.91 -20.54 -55.90 -20.59 -18.19 -26.58 -27.07 8.47 0.31
  • 16. Quantization (Example) 43.70 3.93 5.52 4.51 1.00 -0.64 0.22 -0.07 -10.82 -5.96 -5.02 -3.86 2.29 -0.41 0.38 -0.04 6.12 2.33 3.86 1.87 0.37 0.30 0.22 -0.24 -2.91 0.60 -0.80 -1.92 0.60 -0.03 -0.26 -0.02 -8.75 -2.25 0.36 -0.03 -0.13 0.21 -0.08 -0.12 3.85 -0.26 0.83 -0.75 -0.72 -0.09 -0.25 0.11 -1.08 -0.98 -0.04 -0.23 0.54 -0.02 -0.03 0.12 -0.29 -0.61 -0.22 -0.19 -0.24 -0.27 0.08 0.00 ( , ) ( , ) F u v Q u v 44 4 6 5 1 -1 0 0 -11 -6 -5 -4 2 0 0 0 6 2 4 2 0 0 0 0 -3 1 -1 -2 1 0 0 0 -9 -2 0 0 0 0 0 0 4 0 1 -1 -1 0 0 0 -1 -1 0 0 1 0 0 0 0 -1 0 0 0 0 0 0 ( , ) ( , ) ( , ) q F u v F u v Round Q u v       
  • 17. 4.Zig Zag Scan  8x8 Blocks to a 1x64 Vector.  Why Zig Zag Scan?  To sort 8x8 DCT coefficients based on the spatial frequencies (low frequency coefficients in top of vector). 0 1 2 . . . 63 DC Component (No Frequency) Highest Frequency 1x64 Vector: 0 1 5 6 14 15 27 28 2 4 7 13 16 26 29 42 3 8 12 17 25 30 41 43 9 11 18 24 31 40 44 53 10 19 23 32 39 45 52 54 20 22 33 38 46 51 55 60 21 34 37 47 50 56 59 61 35 36 49 48 57 58 62 63 Horizontal frequency Vertical frequency
  • 18. Zig-Zag Reordering (Example) 44 4 6 5 1 -1 0 0 -11 -6 -5 -4 2 0 0 0 6 2 4 2 0 0 0 0 -3 1 -1 -2 1 0 0 0 -9 -2 0 0 0 0 0 0 4 0 1 -1 -1 0 0 0 -1 -1 0 0 1 0 0 0 0 -1 0 0 0 0 0 0 ( , ) q F u v Zig-Zag Reordering : 44, 4,-11, 6,-6,6, 5,-5,2,-3, -9,1,4,-4,1, -1,2,2,-1,-2,4, -1,0,0,-2,0,0,0, 0,0,0,1,0,1,-1,0, -1,0,-1,0,0,0,0, 0,0,0,-1,0,0, 0,1,0,0,0, 0,0,0,0, 0,0,0, 0,0, 0
  • 19. 5.DPCM & RLE 1. DPCM on DC Component  Differential Pulse Code Modulation.  DC component is large and varied, but often close to previous value. 2. RLE on AC Components  Zero Run Length Encoding.  1 x 64 vector has lots of zeros in it.  57,45,0,0,0,0,23,0,-30,-16,0,0,1,0,0,0, 0 , 0 ,0 , only 0,..,0 RLC: (0,57); (0,45); (4,23); (1,-30); (0,-16); (2,1); EOB EOB = (0,0)
  • 20. Differential Pulse Code Modulation(DPCM) on DC Component DCi1 DCi … … DC1 DC0 0 … … Encode : Diffi = DCi  DCi1 Decode : DCi = DCi1 + Diffi DCs of 88 blocks block 1 block i1 block i Diff1=DC1 Diffi1= DCi1 DCi2 Diffi= DCi DCi1
  • 21. 6.Huffman (Entropy) Coding  DC and AC components finally need to be represented by a  smaller number of bits (Arithmetic coding also supported in place of Huffman coding):  (Variant of) Huffman coding: Each DPCM-coded DC coefficient is represented by a pair of symbols : (Size, Amplitude) where Size indicates number of bits needed to represent coefficient and Amplitude contains actual bits.
  • 22. Huffman Coding (Table of values and bits for the values) Category Values Bits for the value 1 -1,1 0,1 2 -3,-2,2,3 00,01,10,11 3 -7,-6,-5,-4,4,5,6,7 000,001,010,011,100,101,110,111 4 -15,...,-8,8,...,15 0000,...,0111,1000,...,1111 5 -31,...,-16,16,...31 00000,...,01111,10000,...,11111 6 -63,...,-32,32,...63 000000,...,011111,100000,...,111111 7 -127,...,-64,64,...,127 0000000,...,0111111,1000000,...,1111111 8 -255,..,-128,128,..,255 ... 9 -511,..,-256,256,..,511 ... 10 -1023,..,-512,512,..,1023 ... 11 -2047,..,-1024,1024,..,2047 ...
  • 23. Huffman Coding (Huffman table of luminance AC coefficience) run/category code length code word 0/0 4 1010 ... 0/6 7 1111000 ... 0/10 16 1111111110000011 1/1 4 1100 ... 1/5 11 11111110110 ... 4/5 16 1111111110011000 ... 15/10 16 1111111111111110
  • 24. Huffman Coding (Huffman table of luminance DC coefficience) category code length code word 0 2 00 1 3 010 2 3 011 3 3 100 4 3 101 5 3 110 6 4 1110 7 5 11110 8 6 111110 9 7 1111110 10 8 11111110 11 9 111111110
  • 25. Huffman Coding (Example) Run length coding of 63 AC coefficiences : (0,57) ; (0,45) ; (4,23) ; (1,-30) ; (0,-8) ; (2,1) ; (0,0) Encode the right value of these pair as category and bits for the value, except the special markers like (0,0) or (15,0) : (0,6,111001) ; (0,6,101101) ; (4,5,10111); (1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0) The difference of DC coefficience : -511 Encode the value as category and bits for the value : 9, 000000000
  • 26. Huffman Coding (Example) (cont’d) The AC coefficiences : (0,6,111001) ; (0,6,101101) ; (4,5,10111); (1,5,00001) ; (0,4,0111) ; (2,1,1) ; (0,0) Encode the left two value in () using Huffman encoding : 1111000 111001 , 1111000 101101 , 1111111110011000 10111 , 11111110110 00001 , 1011 0111 , 11100 1 , 1010 The DC coefficience : 9, 000000000 Encode the category using Huffman encoding : 1111110 000000000