Graphics File Formats Graphics Data n Vector data

  • Slides: 40
Download presentation
Graphics File Formats

Graphics File Formats

Graphics Data n Vector data – Lines – Polygons – Curves n Bitmap data

Graphics Data n Vector data – Lines – Polygons – Curves n Bitmap data – Array of pixels – Numerical values corresponding to graylevel or color of set of pixels Graphics File Formats 2

Types of Formats n Bitmap – TIFF, GIF, JPEG n Vector – Auto. CAD

Types of Formats n Bitmap – TIFF, GIF, JPEG n Vector – Auto. CAD DXF n Metafile – Can contain both bitmap and vector data in the same file – Macintosh PICT Graphics File Formats 3

Types of Formats n Animation – TDDD, TTDDD n Multimedia – Apple Quick. Time

Types of Formats n Animation – TDDD, TTDDD n Multimedia – Apple Quick. Time – MPEG Graphics File Formats 4

Types of Formats n 3 D – Descriptions of shape and color of 3

Types of Formats n 3 D – Descriptions of shape and color of 3 D object models (scene elements) – Models placed in scenes with lights and cameras – Autodesk’s DXF – Used by rendering programs like Autodesk’s 3 D Studio Graphics File Formats 5

Types of Formats n VRML – Hybrid of 3 D graphics and HTML Audio

Types of Formats n VRML – Hybrid of 3 D graphics and HTML Audio n Video n Fonts n Graphics File Formats 6

Pixels and Coordinates Graphics File Formats 7

Pixels and Coordinates Graphics File Formats 7

Display n Fewer colors than device can display Graphics File Formats 8

Display n Fewer colors than device can display Graphics File Formats 8

Display n More colors than device can display Graphics File Formats 9

Display n More colors than device can display Graphics File Formats 9

Display n Quantization artifacts – Banding – Moire patterns – New colors not present

Display n Quantization artifacts – Banding – Moire patterns – New colors not present in image Graphics File Formats 10

Palettes n 1 -dimensional array of color values – Color map – Index map

Palettes n 1 -dimensional array of color values – Color map – Index map – Color table – Look-up table n Bitmap data in a file stored as series of index values – Pseudo-color storage Graphics File Formats 11

Palettes n Can easily change, say, all red pixels to green Graphics File Formats

Palettes n Can easily change, say, all red pixels to green Graphics File Formats 12

Palettes n Palette element – 24 or 32 bits (0, 0, 0) (255, 255)

Palettes n Palette element – 24 or 32 bits (0, 0, 0) (255, 255) (255, 0, 0) (0, 255, 0) (0, 0, 255) (255, 0) (0, 255) (255, 0, 255) Graphics File Formats (128, 0, 0) (0, 128, 0) (0, 0, 128) (128, 0) (0, 128) (128, 128) (255, 128) 13

Palettes n 320 200 image with 3 bytes of color information per pixel and

Palettes n 320 200 image with 3 bytes of color information per pixel and up to 256 colors – Image without palette would take 320*200*3 bytes of storage, or 192, 000 bytes Graphics File Formats 14

Palettes n 320 200 image with 3 bytes of color information per pixel and

Palettes n 320 200 image with 3 bytes of color information per pixel and up to 256 colors – Image with 1 byte palette would take 320*200*1 + 256*3 (length of palette) bytes of storage, or 64, 768 bytes – For small amounts of data, palette length could outweigh savings in color encoding Graphics File Formats 15

Color Spaces Composite colors are defined by specifying three values for amounts of fundamental

Color Spaces Composite colors are defined by specifying three values for amounts of fundamental colors, or color channels n Color is a point in color space n Graphics File Formats 16

Color Spaces n RGB – Red, green, and blue – (R, G, B) (0%,

Color Spaces n RGB – Red, green, and blue – (R, G, B) (0%, 0%) is black (100%, 100%) is white (50%, 50%) is light gray (100%, 0%) is red (0%, 100%, 0%) is green (0%, 100%) is blue Graphics File Formats 17

Color Spaces n RGB – 24 bit RGB n Range is 0 -255 (0,

Color Spaces n RGB – 24 bit RGB n Range is 0 -255 (0, 0, 0) is black (255, 255) is white (127, 127) is light gray (255, 0, 0) is red (0, 255, 0) is green (0, 0, 255) is blue Graphics File Formats 18

Color Spaces n Truecolor – Human eye can distinguish 224 colors – Device equal

Color Spaces n Truecolor – Human eye can distinguish 224 colors – Device equal to or exceeding this is said to display truecolor – No palette needed n Graphics File Formats First byte is R, second byte is G, third byte is B 19

Color Systems n Additive color systems – Adding colors to black creates new colors

Color Systems n Additive color systems – Adding colors to black creates new colors – The more colors that are added, the closer to white we get – Presence of all colors creates white, while absence of all colors creates black – Additive color environments are selfluminous n Graphics File Formats Color on monitors 20

Color Systems n Subtractive color systems – Primary colors subtracted (absorbed) from white to

Color Systems n Subtractive color systems – Primary colors subtracted (absorbed) from white to create new colors (reflected) – The more colors that are subtracted, the closer to black we get – Presence of all primary colors creates black, while absence of all primary colors creates white – Subtractive color environments are reflective Graphics File Formats n Color on paper 21

Color Systems n RGB – Additive – Most widely used – For graphics monitors

Color Systems n RGB – Additive – Most widely used – For graphics monitors Graphics File Formats 22

Color Systems n CMY – Cyan-Magenta-Yellow – Subtractive – Used by most laser and

Color Systems n CMY – Cyan-Magenta-Yellow – Subtractive – Used by most laser and ink-jet printers – CMYK K stands for black, independently n Glossy magazines n Graphics File Formats which is treated – A dot of composite color is a grouping of four dots, each one a CMYK color 23

Color Systems n HSV – Hue-Saturation-Value – Hue n Specifies color – Saturation Called

Color Systems n HSV – Hue-Saturation-Value – Hue n Specifies color – Saturation Called chroma n Refers to amount of white in a hue n – Fully saturated hue contains no white and is pure – Red hue with 50% saturation is pink Graphics File Formats 24

Color Systems n HSV – Value Called brightness n How much light color emits

Color Systems n HSV – Value Called brightness n How much light color emits n Hue with high value is very bright n Hue with low value is black n – Color system used by painters n Graphics File Formats Add white, black, and gray to pure pigments to create tints, shades, and tones 25

Color Systems n HSV n Tints – A pure, fully saturated color combined with

Color Systems n HSV n Tints – A pure, fully saturated color combined with white n Shade – A pure, fully saturated color combined with black n Tone – A pure, fully saturated color combined with black and white (gray) Saturation is the amount of white added n Value is the amount of black added n Hue is the color that is added to n Graphics File Formats 26

Overlays and Transparency n Images are often overlaid on live video sources at rendering

Overlays and Transparency n Images are often overlaid on live video sources at rendering time – On TV, still images are shown next to live talking heads on the news Normal images are opaque n To allow image overlay, some means must exist to specify transparency of an image, an image area, or an image pixel n Graphics File Formats 27

Overlays and Transparency n Add overlay bit to image pixel value – When bit

Overlays and Transparency n Add overlay bit to image pixel value – When bit is set, rendering application ignores those pixel values n A rendering application can selectively toggle overlay bit in all pixel values of a given color – Person standing in front of a contrasting, uniformly colored background screen of a color which doesn’t appear elsewhere Graphics File Formats 28

Overlays and Transparency n A rendering application can selectively toggle overlay bit in all

Overlays and Transparency n A rendering application can selectively toggle overlay bit in all pixel values of a given color – Rendering application can toggle overlay bits of all pixels of this background color, leaving an image of the person cut out from the background – This cut-out image can be overlaid on any other image – Chromakeying n 256 levels of transparency Graphics File Formats 29

Bitmap Files n Image data + header information – Raw format files n n

Bitmap Files n Image data + header information – Raw format files n n Just image data Organization – Header Bitmap data Graphics File Formats 30

Bitmap Files n Organization – Header Bitmap data Footer – Header Palette Bitmap data

Bitmap Files n Organization – Header Bitmap data Footer – Header Palette Bitmap data Footer Graphics File Formats 31

Bitmap Files n Organization Header Bitmap data Palette n Header Palette Scan line table

Bitmap Files n Organization Header Bitmap data Palette n Header Palette Scan line table Color correction table (here) Bitmap data Color correction table (or here) Footer n Graphics File Formats 32

Bitmap Files n Organization – Header Palette Bitmap index Bitmap 1 data … Bitmap

Bitmap Files n Organization – Header Palette Bitmap index Bitmap 1 data … Bitmap N data Footer Graphics File Formats 33

Bitmap Files n Organization Graphics File Formats – Header Palette Bitmap index Palette 1

Bitmap Files n Organization Graphics File Formats – Header Palette Bitmap index Palette 1 Bitmap 1 data Palette 2 Bitmap 2 data … Palette N Bitmap N data Footer 34

Bitmap Files n Header – Binary or ASCII data – Composed of fixed fields

Bitmap Files n Header – Binary or ASCII data – Composed of fixed fields – Format of header varies – Types of fields File identifier n File version n Number of lines per image n Number of pixels per line n Graphics File Formats 35

Bitmap Files n Header – Types of fields Number of bits per pixel n

Bitmap Files n Header – Types of fields Number of bits per pixel n Number of color planes n Compression type n X-origin of image n Y-origin of image n Text description n Unused space n Graphics File Formats 36

Bitmap n Header – File identifier n Unique identifier which identifies the format –

Bitmap n Header – File identifier n Unique identifier which identifies the format – GIF – File version n For GIF, ‘ 87 a’ or ‘ 89 a’ – Number of lines per image Image length n Image height n Number of scan lines n Graphics File Formats 37

Bitmap n Header – Number of pixels per line Image width n Scan line

Bitmap n Header – Number of pixels per line Image width n Scan line width n – Number of bits per pixel Per color plane n Number of bytes per pixel is pixel depth n – X and Y origins n Graphics File Formats Indicates where image lies on output device 38

Color Correction Table n Information to help rendering application in displaying an image on

Color Correction Table n Information to help rendering application in displaying an image on a device different from the one assumed by the creator application Graphics File Formats 39

Scan-Line Table An array of offset values used to index the location of each

Scan-Line Table An array of offset values used to index the location of each scan line n Each offset value indicates the starting position of each scan line n Graphics File Formats 40