DOC PREVIEW
UCSB ECE 160 - Multimedia

This preview shows page 1-2-3-18-19-36-37-38 out of 38 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE160Spring 2008Lecture 3Graphics and Image Data Representations1ECE160 / CMPS182MultimediaLecture 3: Spring 2008Graphics and ImageData RepresentationsECE160Spring 2008Lecture 3Graphics and Image Data Representations2Graphics and ImageData Representations• Graphics/Image Data Types• The number of file formats used inmultimedia continues to proliferate.For example, a list of some file formatsused in the popular productMacromedia Director.ECE160Spring 2008Lecture 3Graphics and Image Data Representations31-bit Images• Each pixel is stored as asingle bit (0 or 1), so alsoreferred to as binary image.• Such an image is also calleda 1-bit monochrome imageor a pure black/white imagesince it contains no color.• We show a sample 1-bitmonochrome image(called “Lena“ by multimediascientists - this is a standardimage used to illustratemany algorithms).ECE160Spring 2008Lecture 3Graphics and Image Data Representations48-bit Gray-scale Images• Each pixel has a gray-value between 0 and 255.Each pixel is represented by a single byte; e.g.,a dark pixel might have a value of 10, and abright one might be 230.• Bitmap: The two-dimensional array of pixelvalues that represents the graphics/image data.• Image resolution refers to the number of pixelsin a digital image (higher resolution alwaysyields better quality).– Fairly high resolution for such an image might be1600x1200, whereas lower resolution might be640x480.ECE160Spring 2008Lecture 3Graphics and Image Data Representations5Multimedia Presentation• Each pixel is usuallystored as a byte (avalue between 0 to255), so a 640x480grayscale imagerequires 300 kB ofstorage (640x480 =307200).• We show the Lenaimage again, but thistime in grayscale.ECE160Spring 2008Lecture 3Graphics and Image Data Representations6Dithering• When an image is printed, the basic strategy ofdithering is used, which trades intensity resolution forspatial resolution to provide ability to print multi-levelimages on 2-level (1-bit) printers.• Dithering calculates patterns of dots such that valuesfrom 0 to 255 correspond to patterns that are more andmore filled at darker pixel values, for printing on a 1-bitprinter.• The main strategy is to replace a pixel value by a largerpattern, say 22 or 44, such that the number of printeddots approximates the varying-sized disks of ink used inanalog, in halftone printing (e.g., for newspaperphotos).– Half-tone printing is an analog process that uses smaller orlarger filled circles of black ink to represent shading, fornewspaper printing.ECE160Spring 2008Lecture 3Graphics and Image Data Representations7Dithering• For example, if we use a 2x2 dither matrixwe can first re-map image values in 0..255 into the newrange 0..4 by (integer) dividing by 256/5. Then, if thepixel value is 0 we print nothing, in a 2x2 area of printeroutput. But if the pixel value is 4 we print all four dots.• The rule is:– If the intensity is > the dither matrix entry then print an on dot atthat entry location: replace each pixel by an nxn matrix of dots.• Note that the image size may be much larger, for adithered image, since replacing each pixel by a 4 4array of dots, makes an image 16 times as large.ECE160Spring 2008Lecture 3Graphics and Image Data Representations8Dithering• A clever trick can get around this problem.Suppose we use a larger, 4x4 dithermatrix, such as• An ordered dither consists of turning onthe printer output bit for a pixel if theintensity level is greater than the particularmatrix element just at that pixel positionECE160Spring 2008Lecture 3Graphics and Image Data Representations9Dithering• An algorithm for ordered dither, with nxn dither matrix, is:BEGINfor x = 0 to xmax // columnsfor y = 0 to ymax // rowsi =x mod nj =y mod n// I(x; y) is the input, O(x; y) is the output,// D is the dither matrix.if I(x; y) > D(i; j)O(x; y) = 1;elseO(x; y) = 0;ENDECE160Spring 2008Lecture 3Graphics and Image Data Representations10Dithering• A grayscale image of “Lena“ and an ordereddither version, with a detail of Lena's right eye.ECE160Spring 2008Lecture 3Graphics and Image Data Representations11Image Data Types• The most common data types for graphics and image fileformats - 24-bit color and 8-bit color.• Some formats are restricted to particularhardware/operating system platforms,while others are “cross-platform" formats.• Even if some formats are not cross-platform, there areconversion applications that will recognize and translateformats from one system to another.• Most image formats incorporate some variation of acompression technique due to the large storage size ofimage files. Compression techniques can be classiedinto either lossless or lossy.ECE160Spring 2008Lecture 3Graphics and Image Data Representations1224-bit Color Images• In a color 24-bit image, each pixel is representedby three bytes, usually representing RGB.– This format supports 256x256x256 possible combinedcolors, or a total of 16,777,216 possible colors.– However such flexibility does result in a storagepenalty: A 640x480 24-bit color image would require921.6 kB of storage without any compression.• An important point: many 24-bit color imagesare actually stored as 32-bit images, with theextra byte of data for each pixel used to store analpha value representing special effectinformation (e.g., transparency).ECE160Spring 2008Lecture 3Graphics and Image Data Representations1324-bit Color Images• The image forestfire.bmp., a 24-bit image in MicrosoftWindows BMP format. Also shown are the grayscaleimages for the Red, Green, and Blue channels, for thisimage.ECE160Spring 2008Lecture 3Graphics and Image Data Representations148-bit Color Images• Many systems can make use of 8 bits ofcolor information (the so-called “256colors") in producing a screen image.• Such image les use the concept of alookup table to store color information.– Basically, the image stores not color, butinstead just a set of bytes, each of which isactually an index into a table with 3-bytevalues that specify the color for a pixel withthat lookup table index.ECE160Spring 2008Lecture 3Graphics and Image Data Representations158-bit Color Images• A 3D histogram of the RGB values of thepixels in “forestfire.bmp'.ECE160Spring 2008Lecture 3Graphics and Image Data Representations168-bit Color Images• The resulting 8-bit image, in GIF format for“forestfire.gif”.ECE160Spring 2008Lecture 3Graphics and Image Data Representations17Color Look-up Tables


View Full Document

UCSB ECE 160 - Multimedia

Download Multimedia
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Multimedia and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Multimedia 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?