Previous Tip  |  Next Tip  |  Design Tips   | [Bill's Home]

18. Scaling graphics for text

When a graphic is scaled down, the resolution of the text is often reduced so that it cannot be read. For example the following graphic was created with a width of 900 pixels, and has been reduced to have a width of 200 pixels.

You can see that the text cannot be properly viewed. Next the image can be stored with a width of 300 pixels, but forced (in HTML) to viewed with a width of 200 pixels with:

<img src="study_at_napier.gif" width="200" height="161">

This then gives the following image:

You can see that the Studying @ napier text is now readable. The only problem with this method is that the file size increases for the larger version. A file listing gives:

21,476 study_at_napier.gif
12,763 study_at_napier_200pixels.gif

which shows that the 200-pixel version has a file size of around 10KB, and the larger version has a file size of around 20KB. Thus we have doubled the file size, but we have considerably improved the readability of the text. In these days of fast Internet connections, the size of the files is not as major a problem as it was a one time. Thus it can be said that the increase in file size is well worth it, as it presents the graphic as it was meant to be shown.

Here is the graphic in its 300-pixel format:

It is even better in a 400-pixel format:

and then if we show this version with 200-pixels:

Thus summarising with the different versions:

Graphic with a 200-pixel width, displayed with a 200-pixel width (10KB file size)

Graphic with a 300-pixel width, displayed with a 200-pixel width (20KB file size)

Graphic with a 400-pixel width, displayed with a 200-pixel width (30KB file size)