File: miff.4

package info (click to toggle)
imagemagick 6%3A6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (242 lines) | stat: -rw-r--r-- 9,995 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
.ad l
.nh
.TH MIFF 4 "$Date: 2004/08/30 01:12:25 $" "ImageMagick"
.SH NAME
MIFF - Magick Image File Format is a platform-independent format for
storing bitmap images.
.SH SYNOPSIS
.B #include <image.h>
.SH DESCRIPTION
A MIFF image file consist of two sections.  The first section is a
header composed of keys describing the image in text form.  The
next section is the binary image data.  The header is separated from
the image data by a \fB:\fP character immediately followed by a
\fBnewline\fP.

The MIFF header is composed entirely of LATIN-1 characters.  The fields
in the header are key and value combination in the
\fIkey=value\fP format, with each key and value separated by an
equal sign (=).  Each \fIkey=value\fP combination is delimited by
at least one control or whitespace character.  Comments may appear in
the header section and are always delimited by braces.  The MIFF header
always ends with a colon (:) character, followed by a \fBctrl-Z\fP
character.  It is also common to proceed the colon with a \fBformfeed\fP
and a \fBnewline\fP character.  The \fBformfeed\fP prevents the listing
of binary data when using \fBmore(1)\fP under Unix where the \fBctrl-Z\fP
has the same effect with the \fBtype\fP command on the Win32 command line.

The following is a list of \fIkey=value\fP combinations that may be
found in a MIFF file:
.TP
.B "background-color=\fIcolor\fP"
.B "border-color=\fIcolor\fP"
.B "matte-color=\fIcolor\fP"
these optional keys reflects the image background, border, and matte
colors respectively. A color can be a name (e.g. white) or a
hex value (e.g. #ccc).
.TP
.B "class=\fIDirectClass\fP"
.B "class=\fBPseudoClass\fP"
the type of binary image data stored in the MIFF file.  If
this key is not present, \fBDirectClass\fP image data is assumed.
.TP
.B "colors=\fIvalue\fP"
the number of colors in a \fBDirectClass\fP image. For a
\fBPseudoClass\fP image, this key specifies the size of the
colormap.  If this key is not present in the header, and the image
is \fBPseudoClass\fP, a linear 256 color grayscale colormap is used
with the image data.  The maximum number of colormap entries is 65535. 
.B "colorspace=\fBCMYK\fP"
the colorspace of the pixel data.  The default is RGB.
.TP
.B "columns=\fIvalue\fP"
the width of the image in pixels.  This is a required key and
has no default.
.TP
.B "compression=\fBBZip\fP"
.B "compression=\fBFax\fP"
.B "compression=\fBJPEG\fP"
.B "compression=\fBLZW\fP"
.B "compression=\fBRLE\fP"
.B "compression=\fBZip\fP"
the type of algorithm used to compress the image data.  If this
key is not present, the image data is assumed to be uncompressed.
.TP
.B "delay \fI<1/100ths of a second>\fP"
the interframe delay in an image sequence.  The maximum delay is 65535.
.TP
.B "depth=\fB8\fP"
.B "depth=\fB16\fP"
the depth of a single color value representing values from 0 to 255
(depth 8) or 65535 (depth 16).  If this key is absent, a depth of 8 is
assumed.
.TP
.B "dispose \fIvalue\fP"
GIF disposal method.

Here are the valid methods:

.nf
     0  No disposal specified.
     1  Do not dispose between frames.
     2  Overwrite frame with background color from header.
     3  Overwrite with previous frame.
.fi
.TP
.B "gamma=\fIvalue\fP"
the gamma of the image.  If it is not specified, a gamma of 1.0
(linear brightness response) is assumed,
.TP
.B "id=\fBImageMagick\fP"
identifies the file as a MIFF-format image file.  This key
is required and has no default.  Although this key can appear anywhere
in the header, it should start as the first key of the header in column
1.  This will allow programs like \fBfile\fP(1) to easily identify the file
as MIFF.
.TP
.B "iterations \fIvalue\fP"
the number of times an image sequence loops before stopping.
.TP
.B "label=\fI{value}\fP"
defines a short title or caption for the image.  If
any whitespace appears in the label, it must be enclosed within braces.
.TP
.B "matte=\fBTrue\fP"
.B "matte=\fBFalse\fP"
specifies whether a \fBDirectClass\fP image has matte data.  Matte data
is generally useful for image compositing.  This key has no meaning
for pseudo-color images.
.TP
.B "montage=\fI<width>x<height>{\+-}<x offset>{\+-}<y offset>\fP
size and location of the individual tiles of a composite image.  See
\fBX(1)\fP for details about the geometry specification.

Use this key 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.  \fI<width>\fP is the size in pixels of each individual tile in
the horizontal direction and \fI<height>\fP is the size in the vertical
direction.  Each tile must have an equal number of pixels in width and
equal in height.  However, the width can differ from the height.  \fI<x
offset>\fP is the offset in number of pixels from the vertical edge of
the composite image where the first tile of a row begins and \fI<y
offset>\fP is the offset from the horizontal edge where the first tile
of a column begins.

If this key is specified, a directory of tile names must follow the
image header.  The format of the directory is explained below.
.TP
.B "page=\fIvalue\fP"
preferred size and location of an image canvas.
.TP
.B "profile-icc=\fIvalue\fP"
the number of bytes in the International Color Consortium color profile.
The profile is defined by the ICC profile specification located at
ftp://sgigate.sgi.com/pub/icc/icc34.ps.
.TP
.B "colorspace=\fBRGB\fP"
.TP
.B "red-primary=\fIx,y\fP"
.B "green-primary=\fIx,y\fP"
.B "blue-primary=\fIx,y\fP"
.B "white-point=\fIx,y\fP"
this optional key reflects the chromaticity primaries and white point.
.TP
.B "rendering-intent=\fBsaturation\fP"
.B "rendering-intent=\fBperceptual\fP"
.B "rendering-intent=\fBabsolute\fP"
.B "rendering-intent=\fBrelative\fP"
Rendering intent is the CSS-1 property that has been defined by the
International Color Consortium (http://www.color.org).
.TP
.B "resolution=\fI<x-resolution>x<y-resolution>\fP"
vertical and horizontal resolution of the image.  See \fBunits\fP
for the specific resolution units (e.g. pixels per inch).
.TP
.B "rows=\fIvalue\fP"
the height of the image in pixels.  This is a required key
and has no default.
.TP
.B "scene=\fIvalue\fP"
the sequence number for this MIFF image file.  This optional
key is used when a MIFF image file is one in a sequence of files
used in an animation.
.TP
.B "signature=\fIvalue\fP"
this optional key contains a string that uniquely identifies
the image pixel contents.  NIST's SHA-256 message digest algorithm is
recommended.
.TP
.B "units=\fBpixels-per-inch\fP"
.B "units=\fBpixels-per-centimeter\fP"
image resolution units.

Other key value pairs are permitted.  If a value contains whitespace it
must be enclosed with braces as illustrated here:

    id=ImageMagick
    class=PseudoClass  colors=256
    compression=RunlengthEncoded  packets=27601
    columns=1280  rows=1024
    signature=d79e1c308aa5bbcdeea8ed63df412da9
    copyright={Copyright (c) 2001 ImageMagick Studio}
    <FF>
    :

.PP
Note that \fIkey=value\fP combinations may be separated by newlines or
spaces and may occur in any order within the header.  Comments (within
braces) may appear anywhere before the colon.

If you specify the \fBmontage\fP key in the 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
\fBnewline\fP character.  The list is terminated with a NULL character.

If you specify the \fBcolor-profile\fP key in the header, follow
the header (or montage directory if the \fBmontage\fP key is in the
header) with the binary color profile.

Next comes the binary image data itself.  How the image
data is formatted depends upon the class of the image as specified (or
not specified) by the value of the \fBclass\fP key in the header.

DirectClass images (class=DirectClass) are continuous-tone, images
stored as RGB (red, green, blue), RGBA (red, green, blue, alpha), or
CMYK (cyan, yellow, magenta, black) intensity values as defined by the
colorspace key. Each intensity value is one byte in length for
images of depth 8 (0..255), whereas, images of depth 16 (0..65535)
require two bytes in most significant byte first order.

PseudoClass images (class=PseudoClass) are colormapped RGB images. The
colormap is stored as a series of red, green, and blue pixel values,
each value being a byte in size. If the image depth is 16, each
colormap entry consumes two bytes with the most significant byte being
first. The number of colormap entries is defined by the colors key.
The colormap data occurs immediately following the header (or image
directory if the montage key is in the header). PseudoClass image
data is an array of index values into the color map. If there are 256
or fewer colors in the image, each byte of image data contains an index
value. If the image contains more than 256 colors or the image depth is
16, the index value is stored as two contiguous bytes with the most
significant byte being first. If matte is true, each
colormap index is followed by a 1 or 2-byte alpha value.

The image data in a MIFF file may be uncompressed, runlength encoded,
Zip compressed, or BZip compressed. The compression key in the
header defines how the image data is compressed. Uncompressed pixels
are just stored one scanline at a time in row order. Runlength encoded
compression counts runs of identical adjacent pixels and stores the
pixels followed by a length byte (the number of identical pixels minus
1). Zip and BZip compression compresses each row of an image and
preceeds the compressed row with the length of compressed pixel bytes
as a word in most significant byte first order.

MIFF files may contain more than one image.  Simply concatenate each
individual image (composed of a header and image data) into one file.
.SH SEE ALSO
.B
display(1), animate(1), import(1), montage(1), mogrify(1), convert(1), more(1), compress(1)
.SH COPYRIGHT
See http://www.imagemagick.org/www/Copyright.html
.SH AUTHORS
John Cristy, ImageMagick Studio