Transcript

IMAGE IMAGE COMPRESSIONCOMPRESSION

SUBMITTED BY-

MAHAK MALIK 2K4/IT/931

NIKHIL AGARWAL 2K4/IT/937

SHRUTI ARORA 2K4/IT/955

AGENDAAGENDAWhat is Image Compression?Why Image Compression?Lossless and lossy techniquesBitmap formatGraphics Interchange FormatPortable Network Graphics FormatTag Image File FormatJPEGJPEG 2000

Video Compression Principles◦ Frames◦ Types of frames◦ I-frames◦ P-frames◦ B-frames◦ PB-frames◦ D-frames

Standards◦ H.261◦ H.263

ConclusionReferences

What is Image What is Image Compression?Compression?A technique used to reduce the

volume of information to be transmitted about an image

M

Width 1 Unit

M

1/2

D

Height 1 Unit

1/2

M=Number of Samples

D=Spacing Between Samples

Why image compression?Why image compression?Requirements may outstrip the

anticipated increase of storage space and bandwidth

For data storage and data transmission◦DVD◦Real time applications◦Printer

Take advantage of :◦Spatial redundancy◦Temporal redundancy (videos)

Lossless or Lossy Lossless or Lossy CompressionCompressionLossless compression

◦ There is no information loss, and the image can be reconstructed exactly the same as the original

◦ e.g RLE◦ Applications: Medical imagery, Archiving

Lossy compression◦ Information loss is tolerable◦ e.g JPEG 2000◦ Applications: commercial distribution (DVD)

and rate constrained environment where lossless methods can not provide enough compression ratio

Bitmap FormatBitmap FormatFiles with .bmp extensionEach pixel is represented by a fixed

number of bits (integral power of 2)A typical BMP file usually contains the

following blocks of data:o BMP Header Stores general informationo Bitmap Information Stores detailed

informationo Color Palette Stores the definition of the

colors o Bitmap Data Stores the actual image, pixel by

pixel.

AdvantagesAdvantagesSimpleWidely usedRelatively well documentedFree of patents

DisadvantagesDisadvantagesMinimum or zero compression

Graphics Interchange Graphics Interchange FormatFormat256 colors out of a palette of 224

colors are indexed Uses LZW(patented by Unisys) Amongst the oldest formats availableSupports animationsSupports transparency and interlacing

Portable Network Graphics Portable Network Graphics FormatFormat

Developed to improve upon and replace GIF

Supports 2D interlacing, transparency and variable color depth

Uses lossless data compression method called DEFLATE

Type Bits per channel

Indexed 1 2 4 8

Greyscale 1 2 4 8 16

Greyscale & alpha 16

32

Truecolor 24

48

Truecolor & alpha 32

64

A PNG image with an 8-bit transparency channel (left). The same image is overlaid onto a checkered background (right), to highlight the transparency.

The only disadvantage of png is that it doesn’t support animations.

Tag Image File FormatTag Image File FormatDeveloped by Aldus and MicrosoftTags used to indicate how data is

arrange and compressede.g LZW/RLE compression

Advantages : ◦Highly flexible and platform

independent◦Widely used by scanning,faxing, word

processing, image manipulation apps◦allows the inclusion of an unlimited

amount of private or special-purpose information

◦capable of describing bilevel, grayscale, palette-color, and full-color image data

Disadvantages : ◦TIFF image can’t have more than

4GB of data◦Difficult to write TIFF readers which

take advantage of all its features

JPEGJPEGJoint Photographic Expert’s GroupInternational standard for photographsLossless/lossyBased on the facts that :

◦Humans are more sensitive to lower spatial frequency components

◦A large majority of useful image contents change relatively slowly across images

JPEG EncodingJPEG EncodingCr

YCb Quantization

Fq(u, v)

DPCM

RLC

Entropy Coding

HeaderTables

Data

CodingTables

Quant…Tables

F(u, v)

8 x 8

DCTf(i, j)

8 x 8

Zig ZagScan

Steps involved : Steps involved : Image converted to Y,Cb,Cr formatDivided into 8x8 blocksEach 8x8 block subject to DCT

followed by quantizationZig-zag scanDC coefficients stored using DPCMRLE used for AC coefficientsHuffman encoding Frame generation

. . .

1x64

0 0 0 0 0 1 1 0 0 0 0 0

5,1

0 0

7,2

0 . . .2

45

54

48

45

9

-6

1x64

1x64

1x64

1x64

1x64

1x64

a. Zig-zag scanb. DPCM of DC

coefficientsc. RLE of AC

coefficientsa.

b.

c.

DecodingDecodingSame steps as encoding are

performed in reverse

AdvantagesAdvantages• Compression ratios of 20:1 are easily

attained• 24-bits per pixel can be used leading

to better accuracy• Progressive JPEG(interlacing)

DisadvantagesDisadvantages• Doesn’t support transparency• Doesn’t work well with sharp

edges, they tend to blur unless high resolution is used

• Almost always lossy• No target bit rate

PerformancePerformance

487x414 pixels, Uncompressed, 600471 Bytes,24 bpp85502 Bytes, 3.39 bpp, CR=7

487x414 pixels41174 Bytes, 1.63 bpp, CR=14.7

Comparative analysisComparative analysis

a. 256 color bmp b. gif c. jpeg253 KB 4.08 KB 10.1 KB

d. Png e. tiff6.27 K 16.2 KB

JPEG 2000JPEG 2000Wavelet based image compression

standard

EncodingEncodingDecompose source image into componentsDecompose image and its components into

rectangular tilesApply wavelet transform on each tileQuantize and collect subbands of

coefficients into rectangular arrays of “code-blocks”

Encode so that certain ROI’s can be coded in a higher quality

Add markers in the bitstream to allow error resilience

Wavelet transform of an Wavelet transform of an imageimage

AdvantagesAdvantagesLossless and lossy compressionProgressive transmission by pixel

accuracy and resolutionRegion-of-Interest CodingRandom codestream access and

processingRobustness to bit-errorsContent-based descriptionSide channel spatial information

(transparency)

JPEG vs. JPEG 2000JPEG vs. JPEG 2000

512x512 image reconstructed after compression of 0.2 bpp using JPEG and JPEG 2000 respectively

Frames or PicturesFrames or Pictures

Any video can be thought up of as a sequence of digitized pictures or frames.

Moving Images (Videos)Moving Images (Videos)

Types of Frame CodingTypes of Frame CodingIntra-frame coding – spatial redundancy

JPEG algo applied to each frame independently -> moving JPEG or MJPEG

typical compression ratios bw 10:1 and 20:1

not large enough to produce the needed compression ratios

Inter-frame coding – temporal redundancy

Only a small portion of each frame is involved with any motion, so only info related to those segments is send

Frame typesFrame types

Intra-coded frames or I-frameInter-coded frames

P-frameB-frame

I-frameI-frameEach frame is coded independentlyY (luminance) and Cb, Cr

(chrominance) matrices encoded separately using JPEG algo

I-frames frequently used in order to tackle corruption

N = GOP = no. of frames bw successive I-frames, range(3,12)

P-frameP-frameEncoded using a combination of either

a preceding I-frame or P-frameNo. of P-frames limited as errors

propagate from one p-frame to another

M = prediction span = no. of frames bw a P-frame and the immediately preceeding I-frame or P-frame

B-frameB-frameSecond type of prediction frameTheir contents are predicted using

both past and future framesAllows for occasional fast moving

objectsProvides better motion estimationProvides highest level of compressionAs they are not involved in coding of

other frames they do not propagate errors

Decoding OperationDecoding Operation I-frame: decoded immediately to recreate

original frameP-frame: info decoded, used with preceding I- or

P-frame to derive the decoded frame contentsB-frame: info decoded, used with preceding I- or

P-frame contents and succeeding I- or P-frame contents to derive the decoded frame contents

To minimize time required to decode B-frame, the order of encoding (and transmission) of the frames is altered so that both the preceding and succeeding frames are available when B-frame is being decoded.

PB-framePB-frameTwo neighboring P- and B-frames are

encoded as if they were a single frameIt increases the frame rate without

increasing the resulting bit rate required.

D-frameD-frameUsed in movie / video-on-demand

applicationsUser may wish to rewind or fast-forward

the videoThis requires the compressed video to

be decompressed at much higher speeds

D-frames inserted at regular intervals throughout the stream

By using only the encoded DC coefficients of each block of pixels in the periodically inserted D-frames, a low resolution sequence of frames is provided at much higher speeds

Implementation IssuesImplementation Issues In case of P-frames, the encoding of each

macroblock is dependent on the motion estimation unit. There are 3 possibilities

If the two contents are the same, only the address of the macroblock in the reference frame is encoded

If the two contents are very close, both the motion vector and the difference matrices associated with the reference frame are encoded

If no close match is found, then the target macroblock is encoded in the same way as a macroblock in an I-frame

PerformancePerformanceCompression ratios for I-frames is

similar to that obtained with JPEG and is typically between 10:1 and 20:1 depending on the complexity of the frame contents

Compression ratios for P-frames and B-frames are higher and depend on the search algorithm used. Typical figures are 30:1 for P-frames and 30:1 through 50:1 for B-frames

H.261H.261Designed by ITU-T for video-telephony

and video-conferencing applicationsThe first standard in which the

macroblock concept appeared. Data rate was specified in multiples of

64Kbpskey element: deblocking filtering Uses CIF (352x288) and QCIF

(176x144) format

H.264H.264 H.264 is the standard of both ITU-T VCEG and ISO/IEC

MPEG Gains in compression efficiency of up to 50%

compared to previous standards New key features are:

◦ Enhanced motion compensation◦ Small blocks for transform coding◦ Integer transform◦ Improved deblocking filter◦ Enhanced entropy coding

Increased complexity relative to prior standards Five resolutions (H.261 only does QCIF and CIF):

CIF: 352x28816CIF: 1408x1152 QCIF: 176x144 4CIF: 704x576 SQCIF: 128x96

Conclusion : Conclusion : Every format has its own advantages

and disadvantages.Depending upon the application the

appropriate format should be used.Bmp is simple but heavyOnly redeeming feature of gif : supports

animationsPng better than the rest in overall termsTiff is appropriate where flexibility is

needed

JPEG is good for photographyJPEG 2000 is an all encompassing

standard

References : References : www.ieee.orgwww.en.wikipedia.orgwww.ilixis.com/developer/http://www.libpng.org/pub/png/http://www.w3.orghttp://www.jpeg.orgData compression – The complete

reference by David SalomonMultimedia Communications by Fred

Halsall

“The JPEG 2000 still image coding system” Charilaos Christopoulos, IEEE Transactions on Consumer Electronics, Vol. 46,November 2000

“The JPEG Still Picture Compression Standard” Gregory K. Wallace, IEEE Transactions on Consumer Electronics, Dec 1991

THANK YOUTHANK YOU

top related