Chapter 6. Working with low-resolution devices

The top priority when making barcode images is to make sure that the barcode is readable. Although it seems quite obvious, it is nevertheless not a trivial task, especially when working with a low-resolution device. A low-resolution device is a printer or any target device that has a resolution lower than 300 dpi. A typical example is G3 fax transmission, which has a resolution only at 200 dpi. The computer display has a resolution of 96 dpi. Many thermal transfer printers also fall into this category, with resolution as low as 203 dpi.

Table 6.1. Typical low-resolution devices

Device Resolution
Computer display 96 dpi
G3 Fax machine 200 dpi
Thermal Transfer Printer 203 dpi
Dot matrix printer 150 dpi, 240 dpi, 300 dpi

Why does device resolution become an issue? Modern computer graphics technology is based on a fundamental assumption that the program can address any logical units, being 1/100 inch per unit, or 1/1000 inch per unit. In this way, computer graphics simplifies the drawing process and makes the drawing data more portable. In practice, most devices are raster and the smallest unit they can address is a pixel. You can not print on 1.5 pixels. Even worse, the size of pixel does not match the English or metric unit system used in our daily lives. Let's take a look at the pixel size measured in mils and mm:

Table 6.2. Pixel Size under typical resolutions

dpi (dots per inch) size in mils size in mm
96 10.42 0.265
150 6.67 0.169
203 4.93 0.125
240 4.17 0.106
300 3.33 0.085
600 1.67 0.042

As you can see, the size of pixel is variable from device to device. For a 600-dpi laser printer, there are 600 pixels in an inch. The same number of pixels occupy 6.25 inches on a computer screen, much longer than the one on the printer. To eliminate the tedious work converting the units back and force, computer graphic layer allows drawing commands to be specified with lengths in a logical unit. You could use pixel based drawing, but naturally most of software choose a mapping unit in mils (1/1000th inch) or 0.01 millimeters. This makes programming a lot easier, because the software does not need to address on the pixel level and the drawings are portable from device to device. Unfortunately, this approach works under a major assumption - the actual resolution does not impact the quality of the drawing. This assumption holds true for text renderings and pictures, but not for barcode printing which requires great assurance on the constant width of each element. Converting from logical units to pixels usually results in rounding errors. When rounding errors are accumulated all the way, some elements will no longer keep the required constant widths, resulting in a low quality barcode.