Command Line Interface: ecconv


Image conversion, for example as used in the  Save As dialog , is done by means of the  ecconv program.

You can also use  ecconv directly as a command line program. This is decribed in the following.

The command line syntax is as follows:

  ecconv [options] [@response-file] [input-file [output-file] ] [&]  

Use the & character at the end of the command line to run ecconv as a background task on UNIX.

The  ecconv  program uses right-to-left precedence: if an option is duplicated, the value supplied with the one that is last specified (rightmost) is used. Options and parameters (apart from path names) can be abbreviated as long as they can be unambiguously identified. For example,  -export can be abbreviated to  -ex. Options and parameters (apart from path and host names) may be entered with uppercase and lowercase letters and with underscores between "words". Letters are converted to lowercase and underscores are removed during parsing. For example, -C_map and -cmap are treated the same.

@response-file
A response file may contain any number of options. It provides an alternative to typing the options on the command line; this is useful if you want to do a series of conversions using the same options.

The master-space character @ must precede the name of the response file.

Input File

You can specify an input file in any of the supported 
image file formats  and any format supported through  filters  (the latter includes  PostScript ,  PDF ,  text files ,  CGM ,  and HPGL).

The default is stdin.

You need not specify the format of the input file. It is detected automatically by EasyCopy.

Output File

Specify the name of the output file. The default is stdout.

There is no connection in this context between the output file format and the file name extension. You must specify the format by means of the -export option, and you must supply the complete filename (the extension is not automatically appended).

Basic Options

-sysdir sysdir
Specifies the path name of the system directory, where the AGI password file is located. If the -sysdir option is not supplied, the directory pointed to by the  SYSDIR  variable is used.
 
-tmpdir tmpdir
Specifies the path name of the directory, where temporary files may be written. If the -tmpdir option is not supplied, the directory pointed to by the  TMPDIR  variable is used for temporary files.

Informational Options

-help
Displays help and usage information. The program terminates after displaying help.
 
-version
Displays the version and release date and license information. The program terminates after having displayed the version information.
 
-information
Displays details of the input image file. The program terminates when the image information has been displayed (no conversion is done).
 
 
-status { false | true }
Specifies if progress information is displayed (written to stderr) during conversion.
 
-warning { true | false }
Specifies if warning messages should be issued. Warnings are written to stderr if you have started ecconv from the command line.

File Options

-prompt { true | false }
Specifies a prompt (yes/no) if the output file specification implies overwriting an existing file.
 
-pageno n
Input page number (only for TIFF),
 
-removeinfile { false | true }
Specifies whether the input file should be removed after successful conversion.

Format Options

-export { bmp | cal | ... | xwd }
Specifies the image file format for the output image file:
     Compression
defaultalternate
bmp      MS Windows Bitmapnone
calCALS Raster Type 1g4
catCatia raster picturenone
cgmCGM cell arrayrunlengthnone
gifGIF 87Alzw
jpgJPEGbaselinesequential, progressive, lossless
jp2JPEG 2000irreversiblereversible
pbmPortable Bitmapnone
pngPNG (Portable Network Graphics)  deflate
pcxPCXpackbits
pdfAdobe PDFnonebaseline, deflate, g4
sgiSilocon Graphics RGBnone
stbHP Starbasenone
sunSUN Rasternone
tgaTARGAnone
tifTIFFpackbitsnone, lzw, baseline, lossless, g3, g4, modhuff
xwdX Window Dumpnone

The default is TIFF.

 
-compression method
Specifies the compression method.
method    
noneNo compression
g3CCITT Group 3
g4CCITT Group 4
modhufCCITT modified Huffman
lzwLZW
packbitsOptimized run-length
runlengthSimple runlength
deflateSimilar to LZW
jpgJPEG baseline(same as baseline)
baselineJPEG baseline
sequentialJPEG extended sequential
progressiveJPEG progressive
losslessJPEG lossless
reversibleJPEG 2000 lossless
irreversibleJPEG 2000 lossy
 
-jpegquality n
Specifies the quality of JPEG compression as a number in the range 1 to 20 (corresponds to the JPEG Quality slider in the  File Type Options dialog. This option is used for JPEG (baseline, sequential, and progressive) and TIFF (only when JPEG baseline compression is specified).
 
-sampling { 4 | 2 | 1 }
Specifies the sampling ratio for chrominance components (refer to the corresponding menu in the  File Type Options dialog. This option is used for JPEG (baseline, sequential, and progressive) and TIFF (only when JPEG baseline compression is specified).
 
-rate n
Target compression rate for JPEG 2000. Specify for example -rate 50 if you want to compress 1:50 (to get a file that is 50 times smaller than an uncompressed image). You will normally get a rate which is not smaller than the one you request. However, you cannot obtain arbitrary high compression rates. Small images do not compress as good as large images. Remember also, that the quality decreases, the more you compress.
 
-scalemethod { metric | abstract }
Specifies the scale method of a CGM file. Refer to the description of the corresponding menu in the File Type Options dialog.
 
-profile { ata | cals | pip }
You can specify, that a CGM file is saved with an ATA, CALS, or PIP profile. The default is ATA.

Color Options

-colormode { bestfit | bilevel | gray | rgb | yuv | n }
Specifies the desired color mode of the output image.
bestfit
Choose Best Fit to get the color mode that best preserves the colors of the input image. For example, if the input image is using an RGB-based color map, and the output file format supports color map, the same color map is used for the output image. Otherwise, the best available alternate color mode is used.
bilevel
Bilevel means a bilevel, black-and-white image.
gray
Gray means a gray scale image (8 bits per pixel). In some cases this will be realized as a colormap of 256 shades of gray.
rgb
RGB means a 24-bit RGB image (true color).
yuv
This is the true color representation used for lossy JPEG modes. Conversion between YUV and RGB is done automatically.
n
A color mapped image. By default a color map of 256 colors will be used. A smaller number of colors can be specified by means of the -colors option.
The specified mode is realized as good as possible taking into account:
  1. Color modes supported by the file format;
  2. Constraints imposed by other selected options.
For example, if you select TIFF and one of the facsimile compressions, any image is reduced to bilevel as this is the only supported color mode under these constraints.
Choose bestfit to get the color mode that best preserves the colors of the input image. For example, if the input image is color mapped, and the output file format supports color maps, the same color map is used for the output image. Otherwise, the best available alternate color mode is used.
 
-colors n
Number of colors (1-256, used together with -colormode n).
 
-cmap { bestfit | standard }
Specifies the color map to be used if the selected color mode results in a color map of exactly 256 colors.
bestfit
This is the default. It means a color map giving the best representation of the input image. If the input image is color mapped, the original color map is used, as far as possible; otherwise a color map optimized for the current image is calculated.
standard
This assigns a fixed, predefined color map to the output image. This option is useful if several images are to appear side-by-side on a device that can only display 256 colors.
 
-outputmode { color | gray | bw | eightcolor }
This option specifies a mode that applies before -colormode is used. It corresponds to the setting you can make in the  Color Options dialog.
 
-reversal { none | color | bw | gray }
Color reversal mode. It corresponds to the setting you can make in the  Color Options dialog.
 
-removebgs n
Remove n background colors. It corresponds to the setting you can make in the  Color Options dialog, except that command line parameter supports removal of 0-255 colors, where the dialog is limited to a maximum of 5.
 
-shading { errordiffusion | none }
Specifies the mapping that applies if the color reduction is required. Refer to the topic  Image Dither  for more information.
 
-brightness v
-contrast v
-chrominance v
These options correspond to the three color adjustment sliders in the  Color Options dialog.
These command line options are specified in the range -1.0 - +1.0 whereas the slider settings are in range -100 - +100. A specification like -brightness 0.37 is thus the same as a slider setting of 37.
 
-redtint v
-greentint v
-bluetint v
These options correspond to the three tint balance sliders in the  Color Options dialog.
These command line options are specified in the range -1.0 - +1.0 whereas the slider settings are in range -100 - +100. A specification like -redtint -0.09 is thus the same as a slider setting of -9.
 

Geometry Options

-size widthxheight
Specifies resizing of the output image in pixel measure. Refer also to the -scale option. The -size and -scale options are treated as duplicates.
 
By default the size of the output image is identical to the input image. Specify width or height only to resize the image with the aspect ratio of the input image preserved, or specify both width and height to resize the image to arbitrary aspect ratio.
 
-scale hscalexvscale
Specifies resizing of the image in relative measure (percent of the input image). Refer also to the -size option. The -scale and -size options are treated as duplicates.
 
By default the size of the output image is identical to the input image. Specify only one scale factor (-scale x) to scale the output image with its aspect ratio preserved, or specify both horizontal and vertical scale factors to scale the image to arbitrary aspect ratio.
 
-resolution n
Specifies the resolution of the output image in pixels per inch. This option takes effect for BMP, CALS, CGM, PCX, PDF, PNG, and TIFF formats. Other formats do not support resolution. Resolution information makes it possible to associate a metric size with the image.
 
The default depends on the input image. If no metric information is available for the input image a default of 72 applies.
 
-rotate { 0 | 90 | 180 | 270 }
Specifies a rotation of the image.
 
-mirror { none | horizontal | vertical | both }
Specify that the output image is mirrored (-mirror both is the same as -rotate 180).
 
-interpolation { averaging | bilinear | replication }
Specifies the interpolation method to apply if the image is resized; refer to the topic  Image Scaling.
 
-crop widthxheight+xoffset+yoffset
Specifies that the output image is obtained by cropping a rectangular area within the input image. The width and height of the cropped area are measured from specified xoffset and yoffset. The offsets are relative to the top-left corner of the input image:
 
 
All values are in pixel units. width+xoffset must not exceed the width of the input image, and height+yoffset must not exceed the height of the input image.
 
If both cropping and resizing (-scale or -size option) are specified the resize information refers to the cropped image.

Stamp and Label

-stamptext textstring
Speciefies an outline text to be written diagonally across the image (refer to the  Stamp dialog).
 
-stampcolor { black | red | green | blue | magenta | cyan | yellow | white | inverse }
Specifies the color used for the outline text.
 
-stampweight { light | medium | heavy }
Specifies the font weight of the outline text.
 
-labeltext textstring
Specifies a text to be written as a label at the edge of the image (refer to the  Label dialog).
 
-labelposition { topleft | topcenter | topright | bottomleft | bottomcenter | bottomright }
Specifies the position of the label.

Copyright © 2003, AGI (autoGraph international), www.augrin.com.