Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Using images in Up: Tips and techniques Previous: Images on transparent


Spacing between images

If 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

# Data follows, one character per pixel (white=0, black=1)

000000000000000000000000000000000000000000000000000000000000

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 up previous contents index
Next: Using images in Up: Tips and techniques Previous: Images on transparent

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd