Add annotation at arbitrary image locations using PostScipt fonts.
ANNOTEPS inserts horizontal or vertical text strings into an image. A number of different typeface families are supported, with arbitrary character size, regular or bold weight, and regular or oblique (italic) style. In principal, any typeface family may be used which is supported by Adobe's PostScript language for specifying raster printer output. However, the actual typefaces supported depend on the local installation (see Usernote 1).
Annotation may be placed on an existing image, the input image may be copied and then annotations applied, or a new image with only the annotations may be created. The location of each text string in the image may be specified in terms of any of the four corners of the block of text, the midpoints of any side, or the center of the block.
- IN
- Input image. Image that the annotation is to be placed on. IN may be a single- or multi-band image and may contain BYTE, INTEGER*2, INTEGER*4, or REAL*4 pixel data. Subbanding is allowed but windowing is not.
- IN
- Input image. The image to be copied and annotated. IN may be a singleor multi-band image and may contain BYTE, INTEGER*2, INTEGER*4, or REAL*4 pixel data. Subbanding and windowing are allowed.
- OUT
- Output image. The output image will be the same size as specified for the input image. If IN specifies a logical image comprising more than one image file and the input images do not all have the same data type, then if the data type of the output image is to be the same as the input images (ODTYPE = SAME), the output image will have the same data type as the first input image specified.
- ODTYPE(SAME)
- Output data type. The data type of the output image:
SAME Same as input BYTE BYTE I*2 INTEGER*2 I*4 INTEGER*4 R*4 REAL*4
- OUT
- Output image.
- ODTYPE(BYTE)
- Output data type. The data type of the output image:
BYTE BYTE (default) I*2 INTEGER*2 I*4 INTEGER*4 R*4 REAL*4
- NL
- Number of output lines. The number of lines in the output image.
- NS
- Number of output samples. The number of samples per line in the output image.
All bands of image MYFILE are annotated. The first text string, "this is image", has the top-center of its text block at line 5, sample 100, and is in 12-point Times Roman type. The second string, "number one", has its top edge centered at line 17, sample 100, and is in 20-point Times Roman type. Both strings use default values of left-to-right horizontal orientation, regular style, regular weight, character grey value of 255, background value for the text block of 0, and transparency option of OPAQUE.
All bands of image MYFILE are copied to image MYCOPY which is then annotated. The first text string is oriented vertically, reading from bottom to top, with the top right corner of its text block at line 40, sample 150, and is in 20-point Courier type, the default type face. The second string runs from left to right, with the bottom center of its text block at line 40, sample 150, and is in 20-point CourierBoldOblique. The third string runs from top to bottom, with its top left corner at line 40, sample 280, and is in Courier type. The first and third text strings have grey levels of 0, while the second has a grey level of 100, and all three have a background value of 255. They are inserted into the image in "transparent" mode.
This example creates a single-band image containing labels for a scale bar. The image is 20 lines by 200 samples, with the default background of 0 and default data type of BYTE. The six annotation strings are numeric values with the centers of their top edges all on the image line 1 and spaced horizontally at intervals of 25 samples. The labels are in 12-point Helvetica type, with the default REGULAR style and weight. All labels have the default horizontal orientation, with a character grey level of 200 and a background value of 0.
ANNOTEPS begins by reading the program arguments and associates type face, font size, style, weight, character and background grey levels, and transparency option with each annotation text string.
ANNOTEPS then creates two sets of temporary files, one for processing horizontal text strings and a separate set for vertical text strings. For each orientation, the program first writes a temporary file containing PostScript commands to create the strings. The program invokes the ImageMagick "convert" program to convert the PostScript specifications to a temporary raster image containing the text blocks, in a second temporary file. ANNOTEPS scans this raster image to determine the minimum rectangular bounding box for each rasterized string, adds a background border to it if OPAQUE mode is specified, and determines the starting line and pixel at which the rasterized text block is to be inserted into the output image.
ANNOTEPS then reads the input image, if any is specified, inserts the horizontal and vertical text blocks at their specified locations, and writes out the annotated image. All temporary files are deleted.
For subcommand INPLACE, the user may wish to retain the original values of minimum and maximum for the actual image data if the values of CHARGREY and/or BACKGRND are outside the range of the image data. Program MINMAX can be used to compute the minimum and maximum of the annotated image if desired.
Text string number NNN contains only blanks. ANNOTEPS cannot create a text block for it. Program PIXFILL can be used to insert a block of uniform grey level into an image.
The value specified for CHARGREY or BACKGRND was outside the range of values supported by the image data type XXXX, and was adjusted accordingly to the value specified by DDDD.
An error condition was encountered which prevented further processing. The nature of the error is specified by the preceding message(s).
ANNOTEPS was unable to allocate memory needed for buffers, etc. Unless image is exceptionally large, this is probably a system error; please notify LAS administrator.
The sizes of the images in a logical input image set are not the same or the windows specified for them are different. Use correct window specifications.
The values of LINEPOS and SAMPPOS should be specified relative to the entire input image for subcommand INPLACE; accordingly, window specifications are not supported.
The number of values specified for LINEPOS or SAMPPOS is less than the number of text strings specified by TEXT. There must be one pair of LINEPOS and SAMPPOS values for each string.
The program could not open the temporary file named XXXX. Check that the user has write access to the current working directory. Otherwise, there may be a system problem -- please notify the LAS administrator.
The file XXXX containing PostScript specifications could not be converted. Check that the ImageMagick program "convert" is in the directories specified by the user's PATHNAME variable and that the local versiion of convert supports the specified typeface(s). See User Note 1.
An error occurred while reading from the specified temporary file. Please notify the LAS administrator.
The block needed to enclose the rasterized text for string number NNN will extend outside the specified image window using the specified values of LINEPOS, SAMPPOS, and ALIGN. Adjust these values to move the block sufficiently to bring its corners inside the image window, or use a shorter text string.
An error occurred when the program attemped to rename the temporary rasterized text file created by ImageMagick "convert" from XXXX to YYYY. Notify the LAS administrator.
An error occurred when trying to open an image file for input or output. The cause may be explained by a preceding message. Make sure the input image file exists and that user has read access to it, and that the user has write access to the directory specified for the output file.