Go to the first, previous, next, last section, table of contents.

IMGrotate

IMGrotate rotates an IMG file, either 90 or 180 degrees clockwise. We call the latter--somewhat inaccurately--a "flip". (We haven't needed other rotation angles, so we haven't implemented them.)

The IMG format is an image format output by a few programs, including the one that drives the scanner we have. (Again, we haven't needed other image formats, so we haven't implemented them.)

Both the input and output are IMG files.

The current implementation of IMGrotate uses an extremely slow and stupid algorithm, because it was a quick hack. It would be useful to replace it with a better algorithm. See section Program features, for a reference.

IMGrotate usage

The physical construction of a source to be scanned may make it hard or impossible to end up with an upright image. But the task of extracting characters from an image is complicated by allowing for a rotated image. Hence this program to turn rotated images upright.

By default, the name of the output file is the same as the input file; both are extended with `.img' if necessary. If this would result in the output overwriting the input, `x' is prepended to the output name.

Clockwise rotation

You specify clockwise rotation of an image with the option `-rotate-clockwise'. This rotates the input 90 degrees clockwise. For example, the following (an `h' on its side):

      *****
     *
     *
***********

turns upright.

Flip rotation

You specify "flip" rotation of an image with the option `-flip'. This flips the input end for end and reverses left and right, i.e., does a 180 degree rotation. For example, the following (an `h' upside down and backwards):

  *  *
  *  *
  *  *
   ***
     *
     *
     *

turns upright.

Invoking IMGrotate

This section describes the options that IMGrotate accepts. See section Command-line options, for general option syntax.

The name of the main input file (see section The main input file) is called image-name below.

`-flip'
Rotate the input 180 degrees, i.e., flip it end for end and left to right. See section Flip rotation.
`-help'
Print a usage message. See section Common options.
`-output-file filename'
Write to filename if filename has a suffix. If it doesn't, write to `filename.img', unless that would overwrite the input, in which case write to `xfilename.img'. By default, use image-name for filename.
`-rotate-clockwise'
Rotate the input 90 degrees clockwise. See section Clockwise rotation.
`-verbose'
Output progress reports. See section Common options.
`-version'
Print the version number. See section Common options.

Go to the first, previous, next, last section, table of contents.