Vector and Raster Graphics

There are two types of computer graphics – raster and vector. The raster graphic is composed of pixels and vector graphic is composed of drawing paths. It is important to understand the difference between these two types before you choose the graphics format to save the barcode image.

Raster Graphics

A bitmap is basically an array of pixels with values indicating the color. The bitmap sizes are defined in pixels. BMP, TIF, GIF, JPG, PNG and most other graphics formats are raster graphics. Since the sizes are measured in pixels, the print dimension depends on the resolution of the printer. BMP records every pixels in the image, so the size is very big even for small images. Other formats use compression algorithm to reduce the file size without causing great visual degrading, but remember the barcode is read by machines other than human. Overall, you need to keep the physical size unchanged otherwise you will run into problems.

For example, you generate a barcode with 1 inch wide and 0.75 inch tall. The display device usually have a dpi of 96, that translate 96 pixels per inch. If you save the image into raster graphics format, you get a bitmap array with 96 pixels wide and 72 pixels in height. When you print from a laser printer at 600 dpi, the image shrink to 1/6 of the original size and becomes un-readable. In our Barcode Creator and ActiveX control products, you can set the target resolution. Still when you copy the image form one machine to another, the same problem may arise again.

Vector Graphics

A vector graphic contains the drawing instructions other than the color value in pixels. In Windows platform WMF is most widely used vector graphic format that is supported by all printers. The best feature about WMF is that the dimension measures are completely device independent. It can be easily scaled without losing any characteristics( most likely you will not use the scale feature). We strongly recommend that you save your barcode image in this format. In our Barcode Studio/ActiveX products copy/paste operation is based on WMF format which preserves all the information. Other vector graphics formats include EPS (Encapsulated PostScript), SVG (Scalable Vector Graphics) format. To use EPS, you need to have a printer with postscript enabled. SVG is designed to use with World Wide Web, but they are not widely accepted. WMF is only supported in Windows platforms.

About Fonts

True type fonts are vector graphics. The font file contains directions (contours) to draw the character (called glyph in typological term). A contour can be either a line or a curve. Not all fonts used in Windows are true type fonts, these raster fonts consisting of bitmap definitions of each glyph can not be scaled to very large size, but they generally have the bitmaps for most used point sizes. True type fonts can be used in both Microsoft and Macintosh platforms. Since a font glyph must be scaled in the same ratio horizontally and vertically, you should be aware that if you increase the point size to increase the width, the height is also increased as well. On the other side, when you move one document from one computer to another, you need to make sure that the destination computer has the same font installed. This generally requires another user license. To avoid end user license issue, you can have the fonts embedded in the document.

Choose Graphics Format

Generally speaking we recommend to use WMF format is all your works are done in Windows platforms. That is actually most of people are doing nowadays. But you need to be aware that most of applications are designed to work with raster formats, under this case, we suggest you make sure that the size is specified in physical measures (like inch) other than pixels. Using truetype fonts do have an advantage here since fonts are specified in points, not pixels ( a point is equal to 1/72 inch). If the raster image must be used ( such as to images in the Internet), you can generate two raster images, one for viewing from the screen, one for printing. They have different resolution settings. Our ASP/JSP barcode server allows you to specify the target device’s resolution.