Import or export LAS image using ImageMagick "convert" utility.
CONVERT uses the ImageMagick "convert" utility to convert between LAS image format and the image formats supported by ImageMagick.The images must have either one or three bands. The list of formats supported by ImageMagick can be displayed by entering the Unix command "man ImageMagick". See the User Notes for more information.
- IN
- Name of input non-LAS image. The format of the input image is specified by its file extension, such as ".gif" or ".tiff".
The full list of formats known to the ImageMagick "convert" utility can be displayed by typing "convert" (with no arguments) at the Unix prompt. However, not all of these formats can be successfully converted back to a flat binary array (".gray" or ".rgb") which LAS can interpret. For example, ".tiff" files having either one or three bands can be successfully converted, but only single-band ".gif" files. CONVERT-IN cannot process Postscript (".ps") files at all. A systematic investigation into which file types can be handled has not been attempted -- users should verify that the output is correct (e.g.,using XID) when trying to convert an unfamiliar file type.
- OUT
- Name of output LAS image.
- NL
- Number of lines in input image. If not known, the ImageMagick "display" module can be used to determine this: at the Unix prompt, type "display" followed by the input file name, then move the mouse into the display window, click the right mouse button to get a menu, and select "Miscellany" and "Image Info". Note that the "geometry:" line gives the image width (NS) before the height (NL).
- NS
- Number of pixels per line in input image. If not known, the ImageMagick "display" utility can be used to determine this: at the Unix prompt, type "display" followed by the input file name, then move the mouse into the display window, click the right mouse button to get a menu, and select "Miscellany" and "Image Info". Note that the "geometry:" line gives the the image width (NS) before the height (NL).
- NBAND(1)
- Number of bands in input image (must be 1 or 3).
- ODTYPE("BYTE")
- Data type for output LAS image.
- IN
- Name of LAS image to convert. The image specification may contain spatial and/or spectral windowing, and may specify a logical image comprised of two or three actual image files. However, the total number of input bands specified must be either 1 or 3.
- OUT
- Name of converted output image. The format of the output image is specified by its file extension, such as ".gif", ".tiff", or ".ps". The full list of possible output formats can be displayed by typing "convert" (with no arguments) at the Unix prompt.
A color image in CompuServe graphics interchange format (GIF) with a width of 600 pixels and a height of 500 pixels is converted into LAS format.
Three bands selected from an input image having a larger number of bands are converted to Postscript format.
For subcommand -IN, CONVERT checks that the number of input bands specified is either 1 or 3, and then uses the ImageMagick convert utility to change the input file to either a single-band 8-bit binary array or a three-band 8-bit per band red/green/blue band-sequential (BSQ) array, placing the result in a temporary file with file extension ".gray" or ".rgb", respectively. CONVERT then invokes the LAS TRANSLAS-IN program to convert the temporary file into LAS format.
For subcommand -OUT, CONVERT must first check that the number of bands specified for the input image is either 1 or 3 and determine the number of lines and samples to be output. This is done by using the LAS COPY command to copy the input to a temporary file, applying any spatial and/or spectral windows specified for argument IN; and then using the LAS GETIMGSZ command to obtain the number of bands, lines, and samples in the temporary file. CONVERT then renames the temporary ".img" file to either ".gray" (single band) or ".rgb" (three bands). The ImageMagick convert utility is then invoked to convert the temporary file to the desired output format.
When the conversion is complete, CONVERT deletes the temporary files.
None.
The ImageMagick convert utility primarily supports image formats having not more than 8 bits per pixel. To use CONVERT-OUT for LAS images of other data types, the LAS MAP function should first be used to rescale the pixel values to fall within the range 0 to 255.
The ImageMagick convert utility primarily supports images having either one or three bands. CONVERT-IN cannot handle other types of input. For CONVERT-OUT, input LAS-format images with other numbers of bands can be handled, but only if the image specifier in argument IN explicitly defines a spectral window containing either 1 or 3 bands.