Revised by: Marcos H. Woehrmann January 05, 1995 Written by: Paul H. Yoshimune April 20, 1994
Converting various images to HP RTL for output on an HP650c is generally not a problem, but there are a few pitfalls which many people run into. Let's start with a simple conversion:
alchemy sample.jpg --r7
This will convert the file sample.jpg to an HP RTL file suitable for output to a 650c. Other acceptable compression types are 1, 2, and 6. Types 1 and 2 wait until the plotter has received all the data or its buffer fills before actually beginning to plot. Types 6 and 7 start plotting as soon as the device receives valid data. In any case, the result is a file called sample.rtl. At this point, you could plot the image by using the copy command, with the binary option:
copy /b sample.rtl lpt1:
This assumes your plotter is hooked up to lpt1 (the first parallel port). Note that the /b is required here, and a source of confusion for a great many people. Normally when sending a file directly to a device like this, DOS assumes that you're sending 7-bit ASCII information. Since all RTL files are binary, you lose 1/8th of your information, and the plot fails. Symptoms include lack of colour, a large black box, or no plotter activity at all.
Note that you can also send the data directly to the plotter by specifying the device as the output filename when calling Alchemy. In this case, no RTL file will be created. In general, if you are only plotting one copy of an image, this is the way to go; if you are plotting multiple copies, it is better to create the RTL file once, and copy it to the plotter several times to prevent Alchemy from duplicating work. The syntax looks something like this:
alchemy sample.jpg --r7 lpt1:
Assuming the image was 640x480 to begin with, and there was no DPI information, the resulting plot would be about 2 inches wide and 1.5 inches tall. This is because the plotter is functioning at 300dpi. You will likely want to scale the image. Keep in mind that the default scaling algorithm is nearest neighbor, which will likely produce stairstepping. In most cases, type "b" scaling (linear interpolation) is the best choice because it produces good results in a reasonable amount of time. We've found that we usually get best results with Jarvis, Judice, and Ninke dithering, using a serpentine raster (-ds3). Additionally, it is sometimes worthwhile to add a bit of perturbation (noise). In this case, something like a "-ds3 10" works well.
At this point, you can try plotting the image with a command like:
alchemy sample.jpg --r7 -Xb35.5i -+ -ds3 10 -D300 300 lpt1:
This will generate a plot which is 35.5 inches wide at 300dpi (10,650 pixels), and scaled appropriately in the Y-dimension to preserve the aspect ratio.
The only problem you might have now is that the image is too dark, or there is too much ink on the paper. This will depend on your inks, as well as the type of media you've fed the plotter. If you're using a high-quality glossy paper, this output may be fine. If you're using the plain paper which came with the plotter, you'll likely need to lighten the image some. Lightening the image is usually best done with gamma correction. Alchemy needs both an input and an output gamma to work. For the 650c, an input gamma of 1.0 and output gamma of 1.9 seems to work well. Your mileage may vary. Making the output gamma value lower darkens the image, and making it higher lightens it.
So, finally, if you are sending an image to an HP 650c from an MS-DOS machine, to be plotted full-size, and are using stock paper and inks, this line will often get you nearly optimal results:
alchemy sample.jpg --r7 -Xb35.5i -+ -ds3 10 -D300 300 -Gi1.0 -Go1.9 lpt1:
Sometimes little "dots" will be noticeable in areas of solid colour, which trail off as you move further into the colour. This is the result of dithering, and is as it should be. Oftentimes, however, you want to be able to prevent this. Alchemy supports "coring," which lets you specify an amount of error to disregard when dithering. If the amount of error being passed to a pixel is less than the coring factor, that error is simply thrown away, preventing the random dots.
The coring factor is specified as part of the dithering option, after the perturbation. So, the usage for the dithering option is:
-d[s] [dither type] [perturbation] [coring factor]
To specify a coring factor, you must include the dither type and the perturbation. So, using the above example, with no perturbation, and a coring factor of 20, the command line would look like this:
alchemy sample.jpg --r7 -Xb35.5i -+ -ds3 10 20 -D300 300 -Gi1.0 -Go1.9 lpt1:
If the coring factor is too low, it will be hard to see its effects. If the coring factor is too high, it will negate dithering to a large degree. In the worst case, if you specify a coring factor of 127, dithering will essentially be turned off.
As an aside, when rendering PostScript files to HP RTL when using Image Alchemy PS, you must specify the -Zm2 option for colour output. If this is not specified, it will be assumed that you want the PostScript file rendered in black and white.
How you do this will vary depending on the machine you're working with.
If you have an /etc/printcap file (as found on a Sun running SunOS, for example) that will need to be modified to accept binary data, and not perform any translation or filtering. Then, you can use lpr to send the data to the plotter.
The printcap entry for the plotter must have at least the following entries:
:sh:sf:sb:ms=cs8,-opost:mx#0:
Additionally, you must have the basic fields such as printer name, port, etc. defined. The above entries tell the plotter to suppress headers, suppress formfeeds, suppress banners, set terminal mode to cs8 (binary), not post process, and not limit file size.
If your system does not have a printcap file, but instead uses the /var/spool/lp/interface directory (as found on an SGI, for example) to determine how to send data to the plotter you can modify this instead.
In that /var/spool/lp/interface directory there will be a file called HP650 (or plotter or whatever your sysadmin called your plotter when installing it). You need to modify this file, insuring the following settings:
BANNER=0 TRAILER=0 RAW=1
(You may want to make a backup copy of the file before modifying it).
If your systems does not use either of these two mechanism for configuring data ports please contact us.
Alternatively, we have written a short C program called sendserial.c which opens a serial device directly, along with the RTL file, and copies data directly from the file to the device. This bypasses the printcap file entirely, to ensure the data is untouched. If you have access to a C compiler, you can compile this short program yourself and prevent the headaches associated with printcap modification. If you have a parallel connection, however, you are forced to either change to a serial connection or modify the printcap file.
If you have Internet access, you can ftp sendserial.c from ftp://ftp.handmadesw.com/pub. If not, but you have a modem, you can get the program from our bulletin board at +1 510 252 0929. If you have neither, you can call us at +1 510 252 0101 and we'll fax or snail-mail you a copy.