400 likes | 551 Views
Graphics File Formats. Graphics Data. Vector data Lines Polygons Curves Bitmap data Array of pixels Numerical values corresponding to gray-level or color of set of pixels. Types of Formats. Bitmap TIFF, GIF, JPEG Vector AutoCAD DXF Metafile
E N D
Graphics Data • Vector data • Lines • Polygons • Curves • Bitmap data • Array of pixels • Numerical values corresponding to gray-level or color of set of pixels Graphics File Formats
Types of Formats • Bitmap • TIFF, GIF, JPEG • Vector • AutoCAD DXF • Metafile • Can contain both bitmap and vector data in the same file • Macintosh PICT Graphics File Formats
Types of Formats • Animation • TDDD, TTDDD • Multimedia • Apple QuickTime • MPEG Graphics File Formats
Types of Formats • 3D • Descriptions of shape and color of 3D object models (scene elements) • Models placed in scenes with lights and cameras • Autodesk’s DXF • Used by rendering programs like Autodesk’s 3D Studio Graphics File Formats
Types of Formats • VRML • Hybrid of 3D graphics and HTML • Audio • Video • Fonts Graphics File Formats
Pixels and Coordinates Graphics File Formats
Display • Fewer colors than device can display Graphics File Formats
Display • More colors than device can display Graphics File Formats
Display • Quantization artifacts • Banding • Moire patterns • New colors not present in image Graphics File Formats
Palettes • 1-dimensional array of color values • Color map • Index map • Color table • Look-up table • Bitmap data in a file stored as series of index values • Pseudo-color storage Graphics File Formats
Palettes • Can easily change, say, all red pixels to green Graphics File Formats
Palette element 24 or 32 bits (0,0,0) (255,255,255) (255,0,0) (0,255,0) (0,0,255) (255,255,0) (0,255,255) (255,0,255) (128,0,0) (0,128,0) (0,0,128) (128,128,0) (0,128,128) (128,0,128) (128,128,128) (255,128,128) Palettes Graphics File Formats
Palettes • 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
Palettes • 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
Color Spaces • Composite colors are defined by specifying three values for amounts of fundamental colors, or color channels • Color is a point in color space Graphics File Formats
Color Spaces • RGB • Red, green, and blue • (R,G,B) (0%, 0%, 0%) is black (100%, 100%, 100%) is white (50%, 50%, 50%) is light gray (100%, 0%, 0%) is red (0%, 100%, 0%) is green (0%, 0%, 100%) is blue Graphics File Formats
Color Spaces • RGB • 24 bit RGB • Range is 0-255 (0, 0, 0) is black (255, 255, 255) is white (127, 127, 127) is light gray (255, 0, 0) is red (0, 255, 0) is green (0, 0, 255) is blue Graphics File Formats
Color Spaces • Truecolor • Human eye can distinguish 224 colors • Device equal to or exceeding this is said to display truecolor • No palette needed • First byte is R, second byte is G, third byte is B Graphics File Formats
Color Systems • 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 self-luminous • Color on monitors Graphics File Formats
Color Systems • 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 • Color on paper Graphics File Formats
Color Systems • RGB • Additive • Most widely used • For graphics monitors Graphics File Formats
Color Systems • CMY • Cyan-Magenta-Yellow • Subtractive • Used by most laser and ink-jet printers • CMYK • K stands for black, which is treated independently • Glossy magazines • A dot of composite color is a grouping of four dots, each one a CMYK color Graphics File Formats
Color Systems • HSV • Hue-Saturation-Value • Hue • Specifies color • Saturation • Called chroma • Refers to amount of white in a hue • Fully saturated hue contains no white and is pure • Red hue with 50% saturation is pink Graphics File Formats
Color Systems • HSV • Value • Called brightness • How much light color emits • Hue with high value is very bright • Hue with low value is black • Color system used by painters • Add white, black, and gray to pure pigments to create tints, shades, and tones Graphics File Formats
Color Systems • HSV • Tints • A pure, fully saturated color combined with white • Shade • A pure, fully saturated color combined with black • Tone • A pure, fully saturated color combined with black and white (gray) • Saturation is the amount of white added • Value is the amount of black added • Hue is the color that is added to Graphics File Formats
Overlays and Transparency • 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 • To allow image overlay, some means must exist to specify transparency of an image, an image area, or an image pixel Graphics File Formats
Overlays and Transparency • Add overlay bit to image pixel value • When bit is set, rendering application ignores those pixel values • 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
Overlays and Transparency • 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 • 256 levels of transparency Graphics File Formats
Bitmap Files • Image data + header information • Raw format files • Just image data • Organization • Header Bitmap data Graphics File Formats
Bitmap Files • Organization • Header Bitmap data Footer • Header Palette Bitmap data Footer Graphics File Formats
Bitmap Files • Organization • Header Bitmap data Palette • Header Palette Scan line table Color correction table (here) Bitmap data Color correction table (or here) Footer Graphics File Formats
Bitmap Files • Organization • Header Palette Bitmap index Bitmap 1 data … Bitmap N data Footer Graphics File Formats
Bitmap Files • Organization • Header Palette Bitmap index Palette 1 Bitmap 1 data Palette 2 Bitmap 2 data … Palette N Bitmap N data Footer Graphics File Formats
Bitmap Files • Header • Binary or ASCII data • Composed of fixed fields • Format of header varies • Types of fields • File identifier • File version • Number of lines per image • Number of pixels per line Graphics File Formats
Bitmap Files • Header • Types of fields • Number of bits per pixel • Number of color planes • Compression type • X-origin of image • Y-origin of image • Text description • Unused space Graphics File Formats
Bitmap • Header • File identifier • Unique identifier which identifies the format • GIF • File version • For GIF, ‘87a’ or ‘89a’ • Number of lines per image • Image length • Image height • Number of scan lines Graphics File Formats
Bitmap • Header • Number of pixels per line • Image width • Scan line width • Number of bits per pixel • Per color plane • Number of bytes per pixel is pixel depth • X and Y origins • Indicates where image lies on output device Graphics File Formats
Color Correction Table • Information to help rendering application in displaying an image on a device different from the one assumed by the creator application Graphics File Formats
Scan-Line Table • An array of offset values used to index the location of each scan line • Each offset value indicates the starting position of each scan line Graphics File Formats