OOMMF Home next up previous contents index
Next: Vector Field File Format Up: Command Line Utilities Previous: Making Bitmaps from Vector


Bitmap File Format Conversion: any2ppm

The any2ppm program converts bitmap files of various formats into the Portable Pixmap (PPM) P3 (text) format, or another format chosen with the -format option. Supported image formats include PPM, BMP, and GIF.

Launching
The any2ppm launch command is:

tclsh oommf.tcl any2ppm [standard options] [-noinfo] \
   [-f] [-format format] [-o outfile] [infile ...]
where
-noinfo
Suppress writing of progress information to stderr.
-f
Force overwriting of existing (output) files. By default, if any2ppm tries to create a file, say foo.ppm, that already exists, it generates instead a new name of the form foo.ppm-000, or foo.ppm-001, ..., or foo.ppm-999, that doesn't exist and writes to that instead. The -f flag disallows alternate filename generation, and overwrites foo.ppm instead.
-format format
Specify the output image file format. The value ppm is the default, indicating the true color Portable Pixmap (PPM) P3 (ASCII text) format. The gif and bmp formats are also supported. The values P3, P6, and B24 are also accepted with the same meanings as for avf2ppm. Other formats supported depend on what additional image support packages you have as part of your Tcl/Tk installation. The common Img package provides support for the format values jpeg and tiff, among others.
-o outfile
Write output to outname; use ``-'' to pipe output to stdout. The default is to create a new file by stripping the extension, if any, off of each input filename, and appending .ppm.
infile ...
List of input files to process.

Tk Requirement: any2ppm uses the Tk image command in its processing. This requires that Tk be properly initialized, which in particular means that a valid display must be available. This is not a problem on Windows, where a desktop is always present, but on Unix this means that an X server must be running. The Xvfb virtual framebuffer can be used if desired. (Xvfb is an X server distributed with X11R6 that requires no display hardware or physical input devices.)

With the support of a good image package like Img, any2ppm is a fairly complete image format conversion command line tool. As an example, it is straightforward to use any2ppm as a -filter argument to avf2ppm, like so:

tclsh oommf.tcl avf2ppm foo.omf -opatsub .jpg \
    -filter "tclsh oommf.tcl any2ppm -format jpeg"


OOMMF Home next up previous Contents index

OOMMF Documentation Team
January 15, 2004