星期二, 11月 06, 2012

What are Bitmap and Vector graphics and how are they different?

A bitmap (also called "raster") graphic is created from rows of different colored pixels that together form an image. In their simplest form, bitmaps have only two colors, with each pixel being either black or white. With increasing complexity, an image can include more colors; photograph-quality images may have millions. Examples of bitmap graphic formats include GIF, JPEG, PNG, TIFF, XBM, MacPaint, BMP and PCX as well as bitmap ("screen") fonts. The image displayed on a computer monitor is also a bitmap, as are the outputs of printers, scanners and similar devices. They are created using paint programs like Adobe Photoshop.
Vector (also known as "object-oriented") graphics are constructed using mathematical formulas describing shapes, colors and placement. Rather than a grid of pixels, a vector graphic consists of shapes, curves, lines and text which together make a picture. While a bitmap image contains information about the color of each pixel, a vector graphic contains instructions about where to place each of the components. It is even possible to embed a bitmap graphic within a vector graphic, which is how vector-bitmap "hybrid" graphics work. It is not possible, however, to embed vector information within a bitmap. Examples of vector graphic formats are PICT, EPS, and WMF, as well as PostScript and TrueType fonts. They are created with GIS and CAD applications as well as draw programs like Freehand and Corel Draw.
As described below, bitmap and vector graphics both have their strengths and weaknesses:
  • In general, a bitmap graphic is much larger than a similar vector graphic. Bitmap graphics are resolution dependent. If you enlarge a bitmap graphic, it will look jagged. When shrunk, its features become indistinct and fuzzy. This does not happen with vector graphics as their shapes are redrawn to compensate for changes in resolution.
  • Altering vector graphics is easy because the shapes within them can be ungrouped and edited individually. However, vector graphics are difficult to modify or even display when they are not opened in programs that understand their rendering languages. Most paint applications, however, are capable of opening many different kinds of bitmap graphic formats.
  • It is fairly easy to convert one kind of bitmap file into another. It is usually possible to convert a vector graphic into a bitmap. However, while it is sometimes possible to embed a bitmap image as an object within a vector graphic, it is very difficult to convert a bitmap graphic into a true vector graphic. It is even difficult to convert one kind of vector graphic into another (e.g., PICT to WMF).
  • Vector graphics are not appropriate for complex images (e.g., digitized photographs).