Main Page
  Documentation  
  Download
  About  
  Contact
  Links

Stanislav Trubin
© 2003

Documentation

Command line design
Parameter structure follows this rule:
imagecombine layer_name... [-crop left_X left_Y right_X right_Y] [-zoom zoom_level] [-star star_filename star_X star_Y] output_name|stdout

ParameterValuesDescription
imagecombineimagecombineActual name of the graphical engine. Required parameter.
layer_namefilename(s)Filename(s) (and path, if necessary) for particular layer. String.
-crop-cropCrop function enabled. Indicator that the next four parameters will be pixel X and Y values. Optional parameter.
left_Xnon-negative integerThe X location of the top left corner of the crop window. This will become leftmost pixel after crop. Required parameter if '-crop' option was given.
left_Ynon-negative integerThe Y location of the top left corner of the crop window. This will become topmost pixel after crop. Required parameter if '-crop' option was given.
right_Xnon-negative integerThe X location of the bottom right corner of the crop window. This will become rightmost pixel after crop. Required parameter if '-crop' option was given.
right_Ynon-negative integerThe Y location of the bottom right corner of the crop window. This will become bottommost pixel after crop. Required parameter if '-crop' option was given.
-zoom-zoomIndicate that re-zoom will be made on image. Optional parameter.
zoom_level1, or 2, or 4Number that tells at which zoom level the map should be created.
1 - Full zoom-in (no changes, original image size).
2 - Intermediate zoom level. 50% of the geometric dimensions of the original layers
4 - Full zoom-out. 25% of the geometric dimensions of the original layers.
Required parameter if '-zoom' parameter was given.
-star -starIt is an optional parameter to indicate that the next three parameters will be pixel information of the 'star' image.
star_filename filenameFilename for the star image. Required if '-star' parameter was given.
star_X non-negative integerHorizontal location of the star center on the map counting from left top corner of the image after crop(?). Integer. Zero-based. Required if '-star' parameter is given.
star_Y non-negative integerVertical location of the star center on the map counting from left top corner of the image. Integer. Zero-based. Required if '-star' parameter was given.
output_name|stdoutactual filename or string 'stdout'Either a filename for output PPM image or "stdout" string without quotes. In first case, a regular file will be written. Filename should not be an empty string. In second case, the output image will be send to standard output device. Choice of one of these two options is required.

Visual presentation of some parameters
Fig 1. Visual clarification of some parameters

Notes:

It is possible to combine many layers at a time. Each layer name should be separated from other parameters by a single white space character. rom 1 up to the total number of combined layers. Layers have rightmost priority. I.E. the last layer listed in command line will have a higher priority over a layer lister before when decision on replacing pixels comes. At least one valid filename should be given.

Star center location is counted from left top corner of the original image. The star will not be displayed at all if the star does not completely fit inside of the crop window, so it should be completely contained within green region. See Fig 1.

Examples of command line execution

Example 1. Combine three layers, 25% zoom, write image to stdout. Layer2 will be placed on the top of layer1, and layer3 will be placed on top of both of them.
`imagecombine layer1.ppm layer2.ppm layer3.ppm -zoom 4 stdout`

Example 2. The same as above, but the result would be a PNG file with filename output.png
`imagecombine layer1.ppm layer2.ppm layer3.ppm -zoom 4 stdout | pnmtopng > output.png`

Please note, that pnmtopng is a separate tool to convert PPM images into PNG images. This tool is a part of Netpbm package of graphics software.

Example 3. This command will combine three layers, produce cropped image of size 500 by 500 pixels, put the star at location x=200, y=300, make 50% zoom and writes the output file into outputmap.ppm
`imagecombine layer1.ppm layer2.ppm layer3.ppm -crop 0 0 499 499 -star 200 300 -zoom 2 outputmap.ppm`

Example 4. The same command line execution, but it uses a pipe to produce the PNG image, and PNG image will be send to the stdout
`imagecombine layer1.ppm layer2.ppm layer3.ppm -crop 0 0 499 499 -star 200 300 -zoom 2 stdout | pnmtopng`

Hosted by:
SourceForge.net Logo