Sie sind auf Seite 1von 23

JPEG & DIB FILE FORMATS FOR DONE BY: STILL AND BHUPESH JAWA (08BIT057) Slot: Morning

MOTION IMAGES

The JPEG Standard


JPEG is an image compression standard which was accepted as an international standard in 1992. Developed by the Joint Photographic Expert Group of the ISO/IEC For coding and compression of color/gray scale images Yields acceptable compression in the 10:1 range

The JPEG Standard


JPEG is a lossy compression technique Based on the DCT JPEG is a general image compression technique independent of

Image resolution Image and pixel aspect ratio Color system Image compexity

A scheme for video compression based on JPEG called Motion JPEG (MJPEG) exists

The JPEG Standard


JPEG is effective because of the following three observations Image data usually changes slowly across an image, especially within an 8x8 block

Therefore images contain much redundancy

Experiments indicate that humans are not very sensitive to the high frequency data images

Therefore we can remove much of this data using transform coding

The JPEG Standard


Humans are much more sensitive to brightness (luminance) information than to color (chrominance) JPEG uses chroma subsampling (4:2:0) The following slide gives an overview of the various steps in JPEG compression

JPEG Encoding Overview


The main steps in JPEG encoding are the following Transform RGB to YUV or YIQ and subsample color DCT on 8x8 image blocks Quantization Zig-zag ordering and run-length encoding Entropy coding

DCT on Image Blocks


The image is divided up into 8x8 blocks 2D DCT is performed on each block The DCT is performed independently for each block This is why, when a high degree of compression is requested, JPEG gives a blocky image result

Quantization
Quantization in JPEG aims at reducing the total number of bits in the compressed image Divide each entry in the frequency space block by an integer, then round Use a quantization matrix Q(u, v)

Quantization
Use larger entries in Q for the higher spatial frequencies These are entries to the lower right part of the matrix The following slide shows the default Q(u, v) values for luminance and chrominance

Based on psychophysical studies intended to maximize compression ratios while minimizing perceptual distortion Since after division the entries are smaller, we can use fewer bits to encode them

Quantization
Multiple quantization matrices can be used (perhaps by scaling the defaults), allowing the user to choose how much compression to use Trades off quality vs. compression ratio More compression means larger entries in Q An example of JPEG coding and decoding on one image block is shown next

Preparation for Entropy Coding two main steps in JPEG coding: We have seen
DCT and quantization The remaining steps all lead up to entropy coding of the quantized DCT coefficients These additional data compression steps are lossless Most of the lossiness is in the quantization step

Run-Length Coding
We now do run-length coding The AC and DC components are treated differently Since after quantization we have many 0 AC components, RLC is a good idea Note that most of the zero components are towards the lower right corner (high spatial frequencies) To take advantage of this, use zigzag scanning to create a 64-vector

Zigzag Scan in JPEG

JPEG Modes
JPEG supports several different modes Sequential Mode Progresssive Mode Sequential is the default mode Each image component is encoded in a single left-to-right, top-to-bottom scan

This is the mode we have been describing

Progressive Mode
Progressive mode delivers low-quality versions of the image quickly, and then fills in the details in successive passes This is useful for web browsers, where the image download might take a long time
The user gets an approximate image quickly Can be done by sending the DC coefficient and a few AC coefficients first Next send some more (low spatial resolution) AC coefficients, and continue in this way until all of the coefficients have been sent

Sequential vs. Progressive


Click to edit Master text styles Second level Third level Fourth level Fifth level

Click to edit Master text styles Second level Third level Fourth level Fifth level

JPEG Bitstream
The JPEG hierarchical organization is described in the next slide
Frame is a picture Scan is a picture component Segment is a group of blocks Frame header inlcudes

Bits per pixel Size of image Quantization table etc.

Scan header includes

JPEG Bitstream

DIB File Format


TheBMP File Format, also known asBitmap Image FileorDevice Independent Bitmap (DIB) file formator simply aBitmap, is aRaster graphicsimage file formatused to storebitmapdigital images, independently of thedisplay device(such as agraphics adapter), especially onMicrosoft WindowsandOS/2operating systems. The BMP File Format is capable of storing 2Ddigital imagesof arbitrary width, height, and resolution, bothmonochromeand color, in variouscolor depths, and optionally withdata

DIBs in memory
A Bitmap Image File loaded into memory becomes a DIB data structure - an important component of the Windows GDI API. The inmemory DIB data structure is almost the same as the BMP file format, but it does not contain the 14-byte Bitmap File Header and begins with the DIB Header. For DIBs loaded in memory, the Color Table can also consist of 16 bit entries, that constitute indexes to the currently realized palette(an additional level of indirection), instead of explicit RGB color definitions. In all cases, the Pixel Array must begin at a memory

When the size of Gap1 and Gap2 is zero, the inmemory DIB data structure is customarily referred to as "packed DIB" and can be referred to by a single pointer pointing to the beginning of the DIB Header. In all cases, the Pixel Array must begin at a memory address that is a multiple of 4 bytes. In some cases it may be necessary to adjust the number of entries in the Color Table in order to force the memory address of the Pixel Array to a multiple of 4 bytes.For "packed DIBs" loaded in memory, the optional Color Profile data should immediately follow the Pixel Array, as depicted in Diag.1 (with Gap1=0 and Gap2=0). "Packed DIBs" are required byWindowsclipboard API functions as well as

Bitmap file header


Click to edit Master text styles Second level Third level Fourth level Fifth level

DIB Headerthe application detailed (Bitmap This block of bytes tells information about the image, which will be used Information Header) to display the image on the screen. The block
also matches the header used internally by Windows and OS/2 and has several different variants. All of them contain a dword (32bit) field, specifying their size, so that an application can easily determine which header is used in the image. The reason that there are different headers is that Microsoft extended the DIB format several times. The new extended headers can be used with some GDI functions

Das könnte Ihnen auch gefallen