Halftone - October, 1986 Robert B. Goldstein and E. Peli Eye Research Institute of Retina Foundation 20 Staniford St Boston, MA 02114 (617) 742-3140 This is an update of a previous DECUS submission This program takes images that are in greyscale form (ie, pixel values 0-255), and converts to halftone (pixel values 0,1). It does it by an error propagation method published in a paper by Saghri, Hou and Tescher. The size of the output image is only dependant on the characteristics of the target device, not on the input image. It therefore tries to take fullest advantage of the available pixels on the output device. Output can be on a sixel device, a text only CRT, or even on the system lineprinter. Some useful things you should know if you want to try to get this program to run: 1. Adage output device. We have an Adage 3000 image processor on our system. Since most sites do NOT have this hardware, I have removed all support for output to the adage. I did this because some of that software is proprietary to Adage Corp, and also to eliminate the Undefined Globals linker message. 2. PIX logical A logical, PIX, must be defined to point to the directory which holds your images. An image, GIRL, is provided here. To use halftone to operate on GIRL, you must issue the command $ assign [] pix: 3. Image Format Probably most sites will have their own way of storing images. The image is pulled into memory by the routines getimage and imlod_2. Re-write these routines so it is appropriate to your own image formats. The routine imlod_2 that is provided is appropriate to read the image GIRL that is included with this submission. GIRL is an image of the face of a girl. We store images with an associated header file, with an extension .phd that gives info to the program about the image (size, Page 2 etc). Images can be read without the .phd header, but the operator is queried for the missing info. The main item is the size, which, for GIRL, is 128x128. 4. Compilation and linking instructions On our system the following command lines work: $ for halftone $ for half_subs $ link halftone,half_subs You might have to put for/check=nobounds, if your Fortran compiler has /check=bound as a default. I appoligize for this. For reasons I wont go into, I have dummy dimensioned the image buffer (buf) as having the dimension 1 in some routines. 5. Enhancements from previous DECUS submission a. Output of the processed image to a file. b. Re-input of a processed image to just display it. c. Factor of 3 speed-up for the case of a 2x2 'C' matrix (most cases) d. Override of default device dimensions 6. Files in this subdirectory a. AAA_HALFTONE.MEM, RNO - This file b. HALFTONE.COM - Command file for compiling and linking c. HALFTONE.FOR,OBJ,LIS - Fortran source, object and listing d. HALF_SUBS.* - Subroutines needed by Halftone e. GIRL.DAT, GIRL.PHD - Original GIRL image with header file f. GIRL_240.HFT - Already halftoned GIRL. Read in by chosing H for image type. Target device was the VT240. g. GIRL_ALPHA_CRT.LIS - hafltoned girl. Can be typed to ANY device. h. GIRLLA50.SXL - Sixel file for LA50. Can be copied to an LA50 (or LA100?). However, you must have set the width of that device to 511 (the maximum allowed)