Raster Manager Guide
Raster Manager Guide
Raster Manager Guide

Command Line Raster File Conversion

You can convert raster files to other formats via the Raster Convert dialog box, or you can use “rastconv.ma” with the system command line batch file, “msbatch.bat,” to process the files. By default, “msbatch.bat” is delivered to the "Program Files\Bentley\Program\MicroStation" directory.

Command line syntax

Syntax for command line raster file conversion is as follows:

msbatch rastconv inname <<input filename><option1 option2 option3… option8>>

For example, to convert all the PCX files in the C:\pcx directory into TIFF files in the C:\tiff directory, you could use the following command line key-in.

msbatch rastconv inname:c:\pcx\*.pcx outtype:tif outname:c:\tiff\*.tif

The following table lists the available options for command line conversion of raster files.

Keyword

Option

Description

inname:

<inputfilename>

Required — name of input file. May include wildcards.

For details, see the list of Supported Input File Formats

outname:

<outputfilename>

If incomplete, input filename is used.

color:

<rgb|16|256|grayscale|monochrome>

Color depth in output file.

outtype:

bmp — (.bmp) Windows BMP

cal — (.cal) CALS

gtiff — (.tif) Georeferenced TIFF

hmr — (.hmr) HMR

imgmap — (.p) IMG (mapped)

imgpal — (.p) IMG (256 colors)

imgrgb — (.a) IMG (unmapped)

ingrc29 — (.c29) Intergraph 29

ingrcit — (.cit) Intergraph CIT

ingrcot — (.cot) Intergraph COT

ingrrgb — (.rgb) Intergraph RGB

ingrtg4 — (.tg4) Intergraph TG4

itiff — (.itiff) Internet TIFF

jpg — (.jpg) JPEG

pcx — (.pcx) PC Paintbrush

pict — (.pct) Macintosh Pict

png — (.png) PNG

rle — (.rle) Intergraph RLE (monochrome)

sun — (.rs) Sun Raster

targa — (.tga) TrueVision Targa

tiffcomp — (.tif) Compressed TIFF

tiffraw — (.tif) Uncompressed TIFF

Output file type.

See details in the list of Supported Output File Formats.

See note below.

width:

<outputwidth>

Output width defaults to input width.

height:

<outputheight>

Output height defaults to input height.

tiled:

<on|off>

If On, converted files are tiled (does not apply to all formats).

resampled:

<on|off>

If On, any transformation (rotation, affinity) is removed.

nbcolors:

<nbcolors>

Number of colors used to reconstruct the palette.

location:

<hgr|worldfile>

Type of sister file to use for georeference.

hgr — HGR sister file

worldfile — ESRI world file

Hgr and world file may be used only if the file does not have built-in georeference (for example: .jpg or .bmp file formats).

When converting file formats which refer to a dgn file for georeference information, the conversion of the rasterīs data will be correct, but the location of the raster will not be kept. Since “rastconv.ma” operates offline, the raster formats are handled like rasters with no georeference.