Images (GIF)

15
CSN 08704 D ata,A udio,Video and Im ages http://asecuritysite.com/comm s Telecomm unications P rofBill Buchanan Im ages (G IF)

Transcript of Images (GIF)

CSN08704

Data, Audio, Video and Imageshttp://asecuritysite.com/comms

Telecommunications

Prof Bill Buchanan

Images (GIF)

Red Green Blue (RGB)R G B

R G B

R G B

R G B

R G B

R G B

Camera

Display

Colour conversionsRGB

(Red, Green, Blue)

CMYK(Cyan,

Magenta, Yellow, Key)

YUV (Luminosity, Blueness, Redness)

Name (R,G,B) Hex (C,M,Y,K)Black (0,0,0) #000000 (0,0,0,1)White (255,255,255) #FFFFFF (0,0,0,0)Red (255,0,0) #FF0000 (0,1,1,0)Green (0,255,0) #00FF00 (1,0,1,0)Blue (0,0,255) #0000FF (1,1,0,0)Yellow (255,255,0) #FFFF00 (0,0,1,0)Cyan (0,255,255) #00FFFF (1,0,0,0)Magenta (255,0,255) #FF00FF (0,1,0,0)

Y=0 Y=0.5 Y=1

U

V

Y and RGB• Link

• In the images, the lighter the colour intensity (Red, Green, Blue), the more the contribution it has.

Colour Image Capture and Conversion

R G B

R G B

R G B

Camera

RBG RBG RBG RBG

RBG RBG RBG RBG

RBG RBG RBG RBG

RBG RBG RBG RBG

BMP Image (Raw)

JPEGJPEG Image(DCT Conversion)

GIF GIF Image(LZW)

10101010 10101010 10101010

24-bit colour

Camerasensors

Graphics ElementsKey elements of an image are:• The picture resolution. This is defined by the number of pixels in the x-

and y-directions.• The number of colors per pixel. If N bits are used for the bit color then the

total number of displayable colors will be 2N. For example, an 8-bit color field defines 256 colors, a 24-bit color field gives 224 or 16.7M colors. Most computer systems allow for 32-bit color, which gives over 4 billion colors.

• Palette size. Some systems reduce the number of bits used to display a color by reducing the number of displayable colors for a given palette size.

Image Resolution

RBG RBG RBG RBG

RBG RBG RBG RBG

RBG RBG RBG RBG

RBG RBG RBG RBG

BMP Image (Raw)

Image resolution (X × Y)

x pixels

y pixels

Bytes used = (Bytes per colour × X × Y

Graphics FormatsFile Compression

type Max. resolution or colors

TIFF Huffman RLE and/or LZW

48-bit color TIFF (tagged image file format) is typically used to transfer graphics from one computer system to another. It allows high resolutions and colors of up to 48 bits (16 bits for red, green and blue).

PCX RLE 65 53665 536 (24-bit color)

Graphics file format which uses RLE to compress the image. Unfortunately, it make no provision for storing gray scale or color-correcting tables.

GIF LZW

65 53665 536 (24-bit color, but only 256 displayable colors)

Standardized graphics file format which can be read by most graphics packages. It has similar graphics characteristics to PCX files and allows multiple images in a single file and interlaced graphics.

JPG JPEG compression (DCT, Quantization and Huffman)

Depends on the compression

Excellent compression technique which produces lossy compression. It normally results in much greater compression than the methods outlined above.

Graphics file magic numbersDescription Extension Magic NumberAdobe Illustrator .ai 25 50 44 46 [%PDF]Bitmap graphic .bmp 42 4D [BM]JPEG graphic file .jpg FFD8JPEG 2000 file .jp2 0000000C6A5020200D0A [....jP..]GIF graphic file .gif 47 49 46 38 [GIF89]TIF graphic file .tif 49 49 [II]PNG graphic file .png 89 50 4E 47 .PNGPhotoshop Graphics .psd 38 42 50 53 [8BPS]Windows Meta File .wmf D7 CD C6 9APDF Document .pdf 25 50 44 46 [%PDF]Link

[00000000] 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 .PNG........IHDR[00000016] 00 00 00 F3 00 00 00 C3 08 06 00 00 00 57 8C 27 .............W.'

Sample Compression Rates

Type Size(B) Compression(%) BMP 308 278 100.0 BMP, RBG encoded (640480, 256 colors) BMP 301 584 97.8 BMP, RLE encoded PCX 274 050 88.9 PCX, Version 5 GIF 124 304 40.3 GIF, Version 89a, non-interlaced GIF 127 849 41.5 GIF, Version 89a, interlaced TIF 136 276 44.2 TIF, LZW compressed TIF 81 106 26.3 TIF, CCITT Group 3, MONOCHROME JPG 28 271 9.2 JPEG - JFIF Complaint (Standard coding) JPG 26 511 8.6 JPEG - JFIF Complaint (Progressive coding)

Compression with highly redundant information

Type Size (B) Compression (%) BMP 750 054 100.0 BMP, RBG encoded (500500, 16.7M colors) BMP 7 832 1.0 BMP, RLE encoded (256 colors) PCX 31 983 4.3 PCX, Version 5 (256 colors) GIF 4 585 0.6 GIF, Version 89a, non-interlaced (256 colors) TIF 26 072 3.5 TIF, LZW compressed (16.7M colors) JPG 15 800 2.1 JPEG (Standard coding, 16.7M colors) JPG 12 600 1.7 JPEG (Progressive coding 16.7M colors)

GIF Colour Table

GIF uses a colour table of 256 24-bit colours (768 bytes near start of file)

1

256

RGB

RGB

GIF File Format• Link• Link

[00000000] 47 49 46 38 39 61 64 00 55 00 E6 00 00 FF FF FF GIF89ad.U.......[00000016] F7 F7 F6 F1 F4 F2 EE EE EF E7 E7 E7 E1 E4 E6 DF ................[00000032] DE DF D7 DA DD EF CE CE D5 D5 D5 D5 D3 D0 D9 D1 ................

Type: GIF (47,49,46)Version: 89a (38,39,61)Width: 100 (64,00)Height: 85 (55,00)Packed: E6 (E6)Color Index: 00 (00)Aspect: 00 (00)

First colour in colour table (FF FF FF – White)

LZW Compression

R G B RR B G RR G B BG G R R

LZW TableEntry Colour0 Red1 Blue2 Green3 Black4 Red, Green5 Green, Blue6 Blue, Red7 Red, Red8 Red, Blue9 Blue, Green10 Green, Red11 Red, Red, Green12 Green, Blue, Blue13 Blue, Green, Green14 Green, Red, Red

CSN08704

Data, Audio, Video and Imageshttp://asecuritysite.com/comms

Telecommunications

Prof Bill Buchanan

Images (GIF)