1 / 10

CPT 450 Computer Graphics

CPT 450 Computer Graphics. 8th Lecture – Intro to Bitmap or Raster Images. What is the difference between bitmap and vector graphics?. A bitmap or raster image is a collection of pixels (picture element), each with it’s own independent color.

lukee
Download Presentation

CPT 450 Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPT 450 Computer Graphics 8th Lecture – Intro to Bitmap or Raster Images

  2. What is the difference between bitmap and vector graphics? • A bitmap or raster image is a collection of pixels (picture element), each with it’s own independent color. • A vector image is made up of vector graphics instructions such as drawLine or drawEllipse. • From vector to raster – scan conversion • From raster to vector – pattern recognition or OCR

  3. Where do they come from? • Digital Cameras (now in cell phones) • Optical Scanners • Video • Fax • Medical Imaging (X-ray, CAT Scan, MRI) • Satellite data • Generated by scan converting vector graphics instructions

  4. How are bitmap or raster images stored? • Generally, they are rectangular and can be stored in matrix form, as a table of colors. • In the old days, the pixels on the screen were directly mapped to the video memory and this could be addressed directly by the programmer. Convenient but dangerous. • The image files can contain a header and footer. This can contain the width and height of the image, the color depth, and other info about the picture.

  5. File formats

  6. Grayscale images • Only require on intensity per pixel, instead of 3 or 4 for color. • 8 bit can display 256 shades of gray. • Black and white only has two shades. (black or white) • Dithering – use can approximate shades of gray using a dithered black and white image. (like newsprint)

  7. DIB and DDB • Bitmaps can be device dependant (DDB) or device independent (DIB) • Device dependant bitmaps contain color palette info, whereas DIB’s don’t. • The color palette is a lookup table that let’s the file size be smaller, but less total colors can be displayed.

  8. Compression • Bitmap files can get large, so compression algorithms are used. • 2 types of compression algorithms: • Lossless, when uncompressed, the exact bitmap results • lossy. When uncompressed, an approximation to the original bits results.

  9. More on Compression • Lossless algorithms • RLE – Run length encoding. Idea – replace AAAAAAAAAA with 10xA. • LZW Lempel-Ziv and Welch. Used by GIF files. Patent issue has expired. • Lossy methods • Example. JPEG compression. User adjustable compression factor.

  10. Working with Bitmaps in GDI+ • Bitmap class. Derived from Image class. • Important Methods: • GetPixel(I, j) and SetPixel(i, j, color)

More Related