Raster graphics

From Better Practices

Jump to: navigation, search

Raster graphics are graphics that are described by painting each individual element of a grid a particular color. A finer grid will constitute a “better” looking image because the colors will appear to be more continuous. Human eyes naturally see objects in this way except that the grid is radial and extremely dense. Computer screens rasterize all graphics since the screen is composed of pixels that are each painted a particular color. Higher resolution screens equate to a finer grid and thus display “better” looking images. Also, digital cameras capture natural images and rasterize these images for storage onto the camera’s memory card.

One disadvantage of raster graphics is its lack of scalability. Raster graphics cannot be scaled to higher resolutions since such scaling essentially increases the size of each grid element. This scaling produces a larger image, but the image looks no better than the original.

Another disadvantage of raster graphics is its large file sizes. Since each element of the grid must be painted its own color and since each color is typically described with 24 bits (or 3 bytes) of storage, a 1 megapixel image would require 3 megabytes or storage in its uncompressed form. Although lossless techniques may be used to compress the data, they often degrade the quality of the image.

Common raster formats include BMP, GIF, JPG, PNG, among others.

[edit] Vectorizing Raster Graphics

Converting raster graphics to vector graphics usually requires one of the following techniques:

  • Trace the raster graphic either manually or automatically
  • Place a vector “wrapper” around the raster graphic

The former of these is performed when the raster image originates from line art graphics for which its original vector format is not available. There are several tools that can automatically trace these type of graphics including AutoTrace, Potrace, and VectorMagic (among others); however, their results may be less than desirable.

The most common method of vectorizing a raster image is performed when the raster image comes from a photograph or a screenshot. In this case, a vector “wrapper” is placed around the raster graphic to transform the raster into a vector format. Consequently, the resulting vector graphic will maintain the same scalability and filesize limitations of the original raster version. This new graphic is not a true vector graphic, but it will possess a convenient vector wrapper. Because it produces little overhead in filesize and maintains the image’s original quality, sam2p is an excellent application for this scenerio, and Troy Henderson's sam2p web interface is useful when converting only a few graphics.

Personal tools