|
|||||||||
|
Spacing between imagesIf you include a number of images on a line you may find that the space between the images is too small. In this case you can add a `spacer' between the images. This is an image file whose sole purpose is to separate the adjacent images. Normally this will be just one pixel high and be set to a transparent colour. Spacers can be created with a graphics package, but they are quite easy to create with a text editor and an image format conversion filter such as those provided in the PBM utilities. The portable bitmap format is a suitable format to use as it consists solely of text. It starts with a header line that identifies the format (the first two characters should be P1) and then the width and height, followed by lines of up to 70 characters consisting of a zero for a white pixel and a one for a black pixel. Spaces, blank lines and comment lines starting with a # character are ignored. To create a spacer 20 pixels wide, create a file as shown in below:
P1 # "Magic number" to identify this as a PBM file 20 1 # width and height of the image This file can be converted to GIF format using a graphics conversion program such as ppmtogif or ImageMagick. ppmtogif allows you to specify the transparent colour directly:
ppmtogif -transparent white spacer20.pbm >spacer20.gif Extra data is ignored so you can create a file with a large number of lines of ones, and just modify the width field to create different sized spacers.
Next: Using images in Up: Tips and techniques Previous: Images on transparent
Spinning the Web by Andrew Ford |
||||||
Copyright © 1996-2002 Ford & Mason Ltd |