Getting SCHEMA1 on the WEB as a GIF

Suppose we are given a schematic and told to put in on our WEB server as a GIF file so that other designers worldwide can view it. First, how are we going to accomplish this and second, how large a file are we going to generate our GIF file?

Starting Point: HPGL

The schematic we were given was in HPGL format (this was the only non-proprietary format we could easily get. It turns out a large percentage the the schematics ever drawn can be grabbed as HPGL files since almost all of them were plotted.) Fortunately the component and signal labels used th HPGL "LB" text command instead of stroking out the text. This reduced the file size significantly since there is lots of text in this schematic as there is in most schematics.

RIP - Vector to Bitmap

To get a bitmapped GIF file from vector data we need either an HPGL RIP (which are hard to find and expensive) or a Postscript RIP. Fortunately Postscript RIPs are very common. If you are handy with a compiler and really know your way around you can get a freely available program called Ghostscript and use this. I checked out Ghostscript and found one problem - due to the licensing issues with Unisys, the later Ghostscript releases no longer include a direct GIF output. You can get around this by using older versions of Ghostscript or there are instructions on how to get the older source, grab the GIF out and compile the later versions with it. You can also output a different format and then use another program to convert to GIF. Frankly it’s a lot of trouble.

HPGL to PS

Since we didn't have an HPGL RIP we modified an in-house program, HP2DXF and put a simple Postscript output on it. In fact, this may be the basis for a commercial product down the line. Once we had the schematic in Postscript format we could then use a PS RIP to get GIF. (We'll also later use this same Postscript file to run through Adobe's distiller and get PDF)

Image Alchemy PS RIP

We use a low cost commercial RIP called Image Alchemy PS. It turns out that they license their PS front end from the same people that developed Ghostscript but Image Alchemy supports a lot more scaling and output formats than Ghostscript does. I use the 1.10 version running on NT but the previous versions running on UNIX have the necessary functionality.

I wrote a small script to convert the eps file, schema1.eps, into three different GIF files with different resolutions. The same command line works with Unix. Change the rem to # and use the correct path.

     rem  eps to gif translation by Steve DB
     rem  alchlong in_file out_file [options]
     rem  where options are
     rem -Zm0          render to black and white
     rem -Zd 72 72     render to 72/72 dpi
     rem -Ze           use the eps bounding box
     rem -g0           output gif 87a
     rem -o            overwrite existing file w/o prompt
     rem
     c:\alchemy\alchlong schema1.eps   72.gif -Zm0 -Zd 72 72 -Ze -g0 -o
     c:\alchemy\alchlong schema1.eps  150.gif -Zm0 -Zd 150 150 -Ze -g0 -o
     c:\alchemy\alchlong schema1.eps  300.gif -Zm0 -Zd 300 300 -Ze -g0 -o

GIF File Size Generated

   Resolution              GIF File Size
     72 dpi                  29 K bytes
     150 dpi                 82 Kbytes
     300 dpi                211 Kbytes

Note that GIF is a compressed file format and also that this is a black and white 1 bit GIF file.

Viewing the Results

The next step is to view the three GIF files on Netscape and determine how much resolution is satisfactory. Screen shots are shown below. I zoomed in enough so that resolution is limited by the data and not by my screen.

72 DPI

At 72 dpi the text is not readable so someone trying to figure out your schematic from 3000 miles away will have to pick up the phone and ask you about the value of R82.

This is consistent with work we did some years ago when we wrote an HPGL translator for GE Medical - they put their entire service manual on a dial up servers so any tech worldwide could log on and view a machine’s schematic, layout and test information. We settled on 150 dpi as the best compromise between file size and resolution.




150 DPI

At 150 dpi the text is readable. In fact, if we tweak our hp2eps translator we might be able to lighten the font so that it displays even clearer.

One downside of the higher resolution is that you have to pan around a lot to see what is going on. Browsers can’t zoom in on bitmapped graphics files.




300 DPI

At 300 dpi the schematic is very clear but you’ll get carpal tunnel syndrome trying to pan around. The 300 dpi file also prints very nicely. Download time is atrocious on all but the fastest connections.



Download Times

In order to test download times I put the three different gif files on Artwork’s WEB server and dialed in from a couple of remote sites:

Connection
Type
Download Time
- 72dpi
29KB
150dpi
82KB
300dpi
211KB
ISDN 64 111 222 333
14.4 Modem 444 555 666

Clearly those on 14.4 connections are not going to enjoy downloading the 150 dpi or higher resolution files.

Try it yourself?

Want to measure the download time yourself from Artwork's WEB site to your location? Get out your stopwatch and measure how long it takes to bring up each of the following GIFs. Artwork's WEB server is a Sun Sparc and connects to the Internet via a 2 channel (128K) ISDN dedicated line.

Warning - the 211K file takes about 12-15 seconds to download when the WEB page is hit through our local network on a Sun Sparc! It also caused Netscape to hang on a Windows machine!

If you repeat the measurement make sure that you flush your buffer; otherwise the browser will reload the file from its local cache.

Return to Table of Contents