This chapter tells how Davisor Chart measures distances, and in particular what kind of units it uses to do so. Distance units are a fundamental part of any graphics and typography system.
Typography itself is an old art, and over the years, a great number of different typography unit systems has been invented and used throughout the world. The global use of digital typography has cleared the field a bit, but typography units are still one great source of unnecessary confusion. Davisor Chart aims to dissolve this confusion as best as it can, and embrace a global and clear solutions to this problem. This chapter tells how.
Davisor Chart uses pixel units in all length measurements. A pixel is the smallest unit in a raster image, and equal to the integer unit step in vector image coordinate systems.
When working with raster images, the size of objects relative to the underlying pixel grid has a fundamental effect on how the objects appear on the raster image. For this reason, the ability to accurately specify distances in pixel units is very important for many practical applications. In particular, this feature helps to reduce or even remove the need to scale raster image sizes during a pixel based image publishing process. The Avoid Raster Scaling chapter below tells more about this subject.
When working with vector images and other non-raster image formats, a pixel unit is often a usefull base unit, too, even if non-raster images do not utilize the concept of pixels as such. For example, non-raster image coordinate system unit step can be quite easily imagined to correspond the width of one pixel. In fact, many vector font sizes are traditionally expressed in "pixel-like" units, and for example the font size 12 is widely considered as the "standard" size for easily readable Western language text. Consistent use of units regardless of the technical nature of the underlying drawing canvas is also an important benefit by itself, and therefore Davisor Chart uses pixel units in all length measurements, even when working with non-raster images. However, there are many cases where we need to use absolute distance units, too. The Millimeter Units chapter below tells more about this subject.
Avoiding raster image scaling is important because fine details of raster images are often badly deformed by scaling operations. For example, here is an actual and sad result from a certain application (which is better left unnamed) to scale down a raster image. In this example, the damaged image has also been restored back to it's original size to make comparison with the original version easier. As can be seen from the result, the scale operations have damaged the image beyond repair.
|
| Original raster image, displayed with device natural resolution |
|
| Damaged image, after scaling (re-magnified) |
The only way to avoid such damage to raster images is to make sure that they are not scaled at any point during the image publication process. This includes in particular the final displaying step, too, be it a web browser or a printer.
The price of scaling avoidance is that the natural resolution of the final displaying device affects the absolute size in which the image will eventually appear to the viewer. With many printing applications, however, such size fluctuations are often unacceptable. In these cases it is necessary to fix the image size and express it in some absolute units, like millimeters.
When graphics is printed or viewed with printer-like applications, the exact size of the displayed graphics relative to real world objects like a sheet of paper or a display becomes important. It must then be possible to express the real world size of the graphics using some appropriate absolute distance units.
For this purpose, Davisor chart defines the concept of resolution that defines how many pixels make up one metric millimeter. The resulting millimeter distances can then be used for example with Scalable Vector Graphics (SVG) images and eXtendable Stylesheet Language Formatted Objects (XSL-FO) to fit them with other similarly expressed content.
The following example illustrates the simple correspondence between
real world dimensions and the number of rows and columns in pixel
arrays that store raster image content. The raster image in this
example has been specified to be exactly 100mm wide,
50mm high, and have 5ppmm resolution. This
implies that the pixel array beneath must be an array that is
100mm * 5ppmm = 500 pixels wide, and 50mm * 5ppmm =
250 pixels high.
Assuming that the browser you are using to view this document works properly, the example image below should now fill up a 100mm wide and 50mm high area (go ahead and measure it with a ruler if you like).
|
| Array of 500 x 250 pixels, covering a 100 x 50 mm area |
Another way of looking at this example is to see how HyperText Markup Language (HTML) handles it. In particular, all the image size issues described above show up also in HTML image descriptions, too, as shown by the following HTML declaration of the example image above:
<img src="units.png"
width="500" height="250"
style="width:100mm; height:50mm;"/>
According to HTML specification, the width and
height attributes of the <img/> tag
define raster image pixel array size. At the same time,
corresponding Cascading Style Sheet (CSS) style attribute
defines the image physical size. All modern HTML browsers
recognizes these two size concepts, and they use them both to display
images in device resolution intependent way. Unfortunately, this often
means that the image needs to be scaled, which may damage raster image
appearance.
To give you an example of what happens when the physical size information is omitted, here is the same image as above again, but now without any image physical size information. The physical dimensions of the resulting image now depend entirely on the resolution and other factors of the device you are currently viewing this document with, and therefore the image may appear significantly larger or smaller than the intended 100 x 50 mm size. Furthermore, because the display device is now free to use whatever resolution it feels is the most natural for the image, it probably does not need to scale the image. As discussed above, there is therefore a good change that the unscaled raster image below looks better that it's scaled version, above.
|
| Array of 500 x 250 pixels, covering an area of unknown size |
Millimeter and pixels units are not always the best choice to express distance measurements. In particular, a significant portion of computer industry still uses alternative distance units like inch and pixels-per-inch (ppi). There is long history behind this, and the question of what units anybody should use is a wider issue, and sometimes a very sensitive one.
Although Davisor Chart does currently support only millimeter and pixel units directly, new near future versions will support a wider range of different measurement systems. Meanwhile, pixels-per-millimeter values can be computed from pixels-per-inch values like this:
ppmm = ppi / 25.4
The following table relates selected pixels-per-inch values to corresponding approximate pixel-per-millimeter resolutions:
| ppi | ppmm |
| 72 | 2.8 |
| 100 | 3.9 |
| 200 | 7.8 |
| 300 | 11.8 |
| 600 | 23.6 |
| 1200 | 47.2 |