Presentation is loading. Please wait.

Presentation is loading. Please wait.

8th Lecture – Intro to Bitmap or Raster Images

Similar presentations


Presentation on theme: "8th Lecture – Intro to Bitmap or Raster Images"— Presentation transcript:

1 8th Lecture – Intro to Bitmap or Raster Images
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 File type File extension Bitmap .bmp Icon .ico Cursor
Windows meta file .wmf GIF .gif JPEG .jpg or .jpeg TIFF .tif or .tiff Raw image, no header info

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 Lossy methods
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)


Download ppt "8th Lecture – Intro to Bitmap or Raster Images"

Similar presentations


Ads by Google