Return to Main Contents  

NAME


ifftops - translate an Amiga IFF format file into PostScript
 

SYNOPSIS

ifftops [-c] [-h] [-s] [-r <degrees>]
           [-p <x-start>,<y-start>,<x-scale>,<y-scale>]
           <input-file> [<output-file>]  

DESCRIPTION

Ifftops translates Amiga IFF format files - specifically InterLeaved BitMap (ILBM) graphics IFF files - into PostScript format. It handles both black & white images and color images (see NOTE #1 in NOTES section below), including HAM mode images. There are options for positioning an image on the output page, scaling the image (larger or smaller), rotating the image, and placing multiple images on the same output page.

The program works by generating a small PostScript-language "header" followed by a hexadecimal representation (in ASCII), of the bits of the image to render, in a raw format that PostScript understands. When the "header" is executed by the PostScript interpreter (which is commonly embedded in the printer being used) it handles the positioning, scaling, etc. functions and then reads all of the following data to produce the resultant image.

All of the command line arguments are optional. The one piece of information that ifftops needs is the name of the input file to process. If this is not supplied on the command line then the user is prompted for it. (see NOTE #2)

The arguments to ifftops are:
-c          color. Take a color ILBM IFF file and produce a
color PostScript output file. (If this flag is used with a black & white ILBM IFF file then the image is rendered in black & white with an interesting sepia effect.)


-h          hold page image.
In PostScript terminology each printed page is called a page image. By default, ifftops appends a PostScript command at the end of each processed IFF image to cause the current page image to print out. If it is desired to place more than one IFF image onto the same printed page (i.e. page image) then this flag will cause the PostScript command (specifically "showpage") not to be appended. (see "EXAMPLES" below)


-s          smooth.
This flag is my own attempt (very unsophisticated and brute force) at smoothing out the IFF image by doubling the number of pixels, both horizontally and vertically, and averaging the values. (see NOTE #3 below)


-r          rotate.
Rotate the image by the given number of degrees. The value for the degrees must be between 360 and -360. Positive values result in counterclockwise rotation.


-p          position.
Place and size the IFF image within the PostScript page image (i.e. on the resultant printed page.) <x-start> and <y-start> are the PostScript coordinates of the lower left-hand corner of the image to be printed. The defaults for these are 10 and 10 respectively. <x-scale> and <y-scale> are the PostScript dimensions, of the image to be printed, in the x and y directions. The defaults for these are 550 and 480 respectively. (see "EXAMPLES" below)

If an <output-file> is not specified on the command line then the file "out.ps" is used. If the specified (or default) <output-file> already exists then the output is appended to the end of this file (this is so that the "-h" flag (described above) will work.) Be careful that this is what you want - it caused me trouble on several occasions by appending to files when I didn't intend to.  

EXAMPLES

Process the ILBM IFF format file named "dog" and put the resulting PostScript output in the file "dog.ps":
       ifftops dog dog.ps

Position and scale the image to be in the center of the page and to be four inches by three inches:
       ifftops -p 162,288,288,216 dog dog2.ps

Position, scale, and rotate the image so that there are four copys of the image on the page, side-by-side, all four inches by three inches:

        ifftops -h -r 90 -p 306,396,288,216 dog dog3.ps
        ifftops -h -r 90 -p 522,396,288,216 dog dog3.ps
        ifftops -h -r 90 -p 306,108,288,216 dog dog3.ps
        ifftops -r 90 -p 522,108,288,216 dog dog3.ps
 

NOTES


1.)         The color PostScript syntax has only been tested on
a QMS Colorscript-100 printer. Since color Postscript printers are rather new, and since the PostScript syntax for handling color images has not yet been standardized, there is a good chance that the output generated by this program will not work on printers built by other manufacturers. The source code contains preprocessor statements (i.e. "#define QMS") which surround the color PostScript specific lines so, hopefully, it should be straight-forward to add support for other manufacturers' printers, if it is necessary.


2.)         All of the code development for this program was done
on a Sun system running SunOS (i.e. UNIX) for the fairly weak reason that I did not have a compiler for my Amiga at that time (also, the only PostScript printers that I had access to were available via the Sun.) Therefore, I have made sure that the code compiles under both UNIX and AmigaDOS. The source code contains preprocessor statements to toggle the differences between the two environments (mostly "#include" files and some "#define"s). To compile this program for one of the two environments either a "#define AMIGA" or a "#define UNIX" must exist at the beginning of the file. Be sure that ONLY ONE of these two "#define"s is in effect.


3.)         The "-s" flag has very little noticeable effect on a 300 DPI
laser printer. I believe that this is because the default "print cell" size is approximately 50 cells per inch. On the QMS Colorscript-100 printer I prepended the following PostScript code, by hand, to the output file produced by ifftops:

%!
/sfreq 72 def
/sproc {dup mul exch dup mul add 1 exch sub} def
sfreq 60 /sproc load
sfreq 30 /sproc load
sfreq 0 /sproc load
sfreq 0 /sproc load
setcolorscreen
(NOTE: this printer is a four-color printer (YMCB))
(NOTE: the standard PostScript language has a counterpart "setscreen" command for black & white printers.)
The result of adding these lines was a noticeable reduction in the grainyness of the output file.

An unfortunate side effect of this smoothing function is an aprox. 40% increase in the size of the source code file. (I haven't check the relative sizes of the binary files.) Because of this and because of its marginal usefulness, the source code includes preprocessor defines, keyed on the identifier SMOOTH_INCLUDE, which allow the smoothing code to be compiled out of the program. Specifically, if the line "#define SMOOTH_INCLUDE" exists in the source file then the smoothing code will be included.

Happily, the smoothing function only adds a small amount to the total execution time of the program. However, the user should take note that using the "-s" flag causes the output file to be four times larger that it would be without using this flag.  

FILES


out.ps              default output file if none is specified

 

BUGS

There should be a way for the <input-file> and <output-file> to be re-directed from/to standard-input and standard-output.  

AUTHOR

LeRoy Fundingsland, November 1988
(derived from a program called CLAZ which was created by Steve Ludtke, May 1987)


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
NOTES
FILES
BUGS
AUTHOR

This document was created by man2html, using the manual pages.
Time: 14:15:42 GMT, September 04, 2024