MIFF(5) MIFF(5)
NAME
MIFF - ImageMagick's file format for raster images.
SYNOPSIS
#include <image.h>
DESCRIPTION
A MIFF image file consist of two sections. The first sec-
tion is composed of keywords describing the image in text
form. The next section is the binary image data. The two
sections are separated by a : character immediately fol-
lowed by a newline. Generally, the first section has a
form-feed and newline proceeding the : character. You
can then list the image keywords with more, without print-
ing the binary image that follows the : separator.
Each keyword must be separated by at least one space but
can be separated with control characters such a form-feed
or newline.
A list of valid keywords follows:
alpha=True | False
specifies whether a continuous-tone image also has
alpha data. Alpha data is generally useful for image
compositing.
This keyword is optional. If it is not specified, no
alpha data is assumed. This keyword has no meaning
for pseudo-color images.
class=DirectClass | PseudoClass
identifies the type of binary image stored within the
file.
This keyword is optional. If it is not specified, a
DirectClass image format is assumed. An explanation
of DirectClass and PseudoClass image data follows
this list.
colors=value
specifies the number of colors in the image, and for
pseudo-color images the size of the colormap.
This keyword is optional. However, if a colormap
size is not specified, a linear colormap is assumed
for pseudo-color images.
columns=value
is a required keyword and specifies the number of
columns, or width in pixels, of the image.
compression=QEncoded | RunlengthEncoded
identifies how the image stored within the file is
ImageMagick 10 October 1992 1
MIFF(5) MIFF(5)
compressed.
This keyword is optional. If it is not specified,
the image is assumed to be uncompressed. QEncoded
has no meaning for pseudo-color images. A detailed
explanation of runlength-encoded and predictive
arithmetic image compression follows this list.
id=ImageMagick
is a required keyword and identifies this file as a
MIFF image.
montage=<width>x<height>{+-}<x offset>{+-}<y offset>
size and location of the individual tiles of a com-
posite image. See X(1) for details about the geome-
try specification.
Use this keyword when the image is a composite of a
number of different tiles. A tile consists of an
image and optionally a border and a label. <width>
is the size in pixels of each individual tile in the
horizonal direction and <height> is the size in the
vertical direction. Each tile must have an equal
number of pixels in width and equal in height. How-
ever, the width can differ from the height. <x off-
set> is the offset in number of pixels from the ver-
tical edge of the composite image where the first
tile of a row begins and <y offset> is the offset
from the horizonal edge where the first tile of a
column begins.
If this keyword is specified, a directory of tile
names must follow the image header. The format of
the directory is explained below.
packets=value
specifies the number of compressed color packets in
the image data section.
This keyword is optional, but recommended, for run-
length-encoded image compression. It is required for
arithimetic encoded image compression. A detailed
explanation of image compression follows this list.
rows=value
is a required keyword and specifies the number of
rows, or height in pixels, of the image.
scene=value
is an optional keyword and is a reference number for
sequencing of images.
This keyword is typically useful for animating a
sequence of images.
ImageMagick 10 October 1992 2
MIFF(5) MIFF(5)
signature=value
is an optional keyword and is a character string that
uniquely identifies the image colormap.
A unique identifier for the colormap is useful for
animating a sequence of PseudoClass images. The
default identifier is a digital signature computed
from RSA's Data Security MD5 Digest Algorithm
described in Internet draft [MD5], July 1992. The
colormap signature is usually computed for Pseudo-
Class images.
Comments can be included in the keyword section. Comments
must begin with a { character and end with a } character.
An example keyword section follows:
{
Rendered via Dore by Sandy Hause.
}
id=ImageMagick
class=PseudoClass colors=256 signa-
ture=d79e1c308aa5bbcdeea8ed63df412da9
compression=RunlengthEncoded packets=27601
columns=1280 rows=1024
scene=1
^L
:
If you specify montage in the image header, follow the
header with a directory of image tiles. This directory
consists of a name for each tile of the composite image
separated by a NEWLINE character. The list is terminated
with a NULL character.
The binary image data that follows the keyword text is
stored in one of two binary classes as specified by the
class keyword: DirectClass or PseudoClass.
Use the DirectClass class to store continuous-tone images.
DirectClass requires that the image pixels immediately
follow the keyword text and be stored as binary red,
green, and blue intensity values (and optional alpha
value). Each color component is stored as one binary byte
(8 bit) and ranges from 0 through 255. The total number
of pixels expected is equal to the number of pixel columns
times the number of pixel rows as specified by the columns
and rows keywords.
If the compression keyword is not specified, a red, green,
and blue byte (and optional alpha byte) in that order is
expected for each pixel of the image.
If compression is QEncoded, each red, green, and blue byte
ImageMagick 10 October 1992 3
MIFF(5) MIFF(5)
intensity value (and optional alpha value) is encoded
using the predictive arithmetic compression algorithm.
Use the packets keyword to specify the total number of
arithimetic encoded packets that comprise the image.
If compression is RunlengthEncoded, each red, green, and
blue byte intensity value (and optional alpha value) is
followed by a count byte. This value specifies the number
of horizonally contiguous pixels in the image of that
color. The count (0-255) is one less than the actual num-
ber of contiguous pixels; thus a single packet can repre-
sent from 1 up to 256 identical pixels. The total number
of pixels specified by the individual count bytes must add
up to the number of pixel columns times the number of
pixel rows as specified by the columns and rows keywords.
Use packets to specify the total number of runlength-
encoded packets that comprise the image.
Use the PseudoClass class to store pseudo-color images.
PseudoClass requires that the image colormap and pseudo-
color pixels immediately follow the keyword text. The
colormap is stored as contiguous red, green, and blue
intensity values. Each color component is stored as one
binary byte (8 bit) and ranges from 0 through 255. The
number of intensity values expected is determined by the
colors keyword. Note, an image colormap is restricted to
at most 65535 entries. The binary pseudo-color image is
stored as indexes into the colormap. For colormaps of 256
colors or less, the indexes are stored as one binary byte
(8 bit) and ranges from 0 through 255. If the colormap
size exceeds 256 entries, then each colormap index is two
bytes each with the most-significant-byte first. The
total number of pixels expected is equal to the number of
pixel columns times the number of pixel rows as specified
by the columns and rows keywords.
If the compression keyword is not specified, a colormap
index is expected for each pixel of the image.
If compression is RunlengthEncoded, each colormap index is
followed by a count byte. This value specifies the number
of horizonally contiguous pixels in the image of that
color. The count (0-255) is one less than the actual num-
ber of contiguous pixels; thus a single packet can repre-
sent from 1 up to 256 identical pixels. The total number
of pixels specified by the individual count bytes must add
up to the number of pixels expected in the image as speci-
fied by the columns and rows keywords. Use packets to
specify the total number of runlength-encoded packets that
comprise the image.
SEE ALSO
display(1), animate(1), import(1), montage(1), mogrify(1),
convert(1), more(1), compress(1)
ImageMagick 10 October 1992 4
MIFF(5) MIFF(5)
COPYRIGHT
Copyright 1992 E. I. du Pont de Nemours & Company
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby
granted without fee, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of E. I. du Pont de
Nemours & Company not be used in advertising or publicity
pertaining to distribution of the software without spe-
cific, written prior permission. E. I. du Pont de Nemours
& Company makes no representations about the suitability
of this software for any purpose. It is provided "as is"
without express or implied warranty.
E. I. du Pont de Nemours & Company disclaims all war-
ranties with regard to this software, including all
implied warranties of merchantability and fitness, in no
event shall E. I. du Pont de Nemours & Company be liable
for any special, indirect or consequential damages or any
damages whatsoever resulting from loss of use, data or
profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection
with the use or performance of this software.
AUTHORS
John Cristy, E.I. du Pont de Nemours & Company Incorpo-
rated
ImageMagick 10 October 1992 5