1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
5
<TITLE>GraphicsMagick - MIFF File Format</TITLE>
6
<META NAME="GENERATOR" CONTENT="StarOffice 7 (Solaris Sparc)">
7
<META NAME="CREATED" CONTENT="20020824;11573700">
8
<META NAME="CHANGEDBY" CONTENT="Robert Friesenhahn">
9
<META NAME="CHANGED" CONTENT="20040418;19132000">
10
<META NAME="DESCRIPTION" CONTENT="GraphicsMagick is a robust
11
collection of tools and libraries to read, write, and
12
manipulate an image in any of the more popular image
13
formats including GIF, JPEG, PNG, PDF, and Photo CD. With
14
GraphicsMagick you can create GIFs dynamically making it
15
suitable for Web applications. You can also resize, rotate,
16
sharpen, color reduce, or add special effects to an image
17
and save your completed work in the same or differing image
19
<META NAME="KEYWORDS" CONTENT="GraphicsMagick, Image Magick, Image Magic, PerlMagick, Perl Magick, Perl Magic, CineMagick, PixelMagick, Pixel Magic, WebMagick, Web Magic, visualization, image processing, software development, simulation, image, software, AniMagick, Animagic, Magick++">
22
TD P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt }
23
P { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt }
24
DT { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt }
25
DD { color: #000000; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt }
26
PRE { color: #000000 }
27
TH P { color: #ffffff; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-size: 12pt }
28
A:link { color: #0085c0 }
29
A:visited { color: #800080 }
33
<BODY LANG="en-US" TEXT="#000000" LINK="#0085c0" VLINK="#800080" BGCOLOR="#ffffff" DIR="LTR">
34
<P><B>Magick Image File Format (MIFF)</B> is a platform-independent
35
format for storing bitmap images. <B>MIFF</B> is a part of the
36
<A HREF="../index.html">GraphicsMagick</A> toolkit of image
37
manipulation utilities for the <I>X Window System</I>. <B>GraphicsMagick</B>
38
is capable of converting many different image file formats to and
39
from <B>MIFF</B> (<I>e.g.</I> <B>JPEG, XPM, TIFF,</B> <I>etc.</I>).
40
</P><A NAME="desc"></A>
41
<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2>
43
<TD BGCOLOR="#52799e">
44
<P ALIGN=LEFT><IMG SRC="../images/right_triangle.png" NAME="Graphic2" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0><B><FONT FACE="Helvetica, Arial"><FONT COLOR="#ffffff">Description</FONT></FONT></B></P>
48
<P>A <B>MIFF</B> image file consist of two sections. The first
49
section is a header composed of keywords describing the image in text
50
form. The next section is the binary image data. The header is
51
separated from the image data by a <TT>:</TT> character immediately
52
followed by a <I>ctrl-Z</I>.</P>
53
<P>The <B>MIFF</B> header is composed entirely of LATIN-1 characters.
54
The fields in the header are keyword and value combination in the
55
<I>keyword</I>=<I>value</I> format, with each keyword and value
56
separated by an equal sign (=). Each <I>keyword</I>=<I>value</I>
57
combination is delimited by at least one control or whitespace
58
character. Comments may appear in the header section and are always
59
delimited by braces. The <B>MIFF</B> header always ends with a colon
60
(<TT>:</TT>) character, followed by a <I>ctrl-Z</I> character. It is
61
also common to precede the colon with a <I>formfeed</I> and a <I>newline</I>
62
character. The <I>formfeed</I> prevents the listing of binary data
63
when using <B>more(1)</B> under Unix where the <I>ctrl-Z</I> has the
64
same effect with the <B>type</B> command on the Win32 command line.
66
<P>The following is a list of <I>keyword</I>=<I>value</I>
67
combinations that may be found in a <B>MIFF</B> file:
70
<DT><B>background-color</B>=<I>color</I>
72
<B>border-color</B>=<I>color</I>
74
<B>matte-color</B>=<I>color</I>
76
these optional keywords reflects the image background, border, and
77
matte colors respectively. A color can be a name (e.g. <I>white</I>)
78
or a hex value (e.g. <I>#ccc</I>).
80
<B>class</B>=<I>DirectClass</I>
82
<B>class</B>=<I>PseudoClass</I>
84
the type of binary image data stored in the <B>MIFF</B> file. If
85
this keyword is not present, <I>DirectClass</I> image data is
88
<B>colors</B>=<I>value</I>
90
the number of colors in a <I>DirectClass</I> image. For a
91
<I>PseudoClass</I> image, this keyword specifies the size of the
92
colormap. If this keyword is not present in the header, and the
93
image is <I>PseudoClass</I>, a linear 256 color grayscale colormap
94
is used with the image data. <BR>The maximum number of colormap
97
<B>columns</B>=<I>value</I>
99
the width of the image in pixels. This is a required keyword and has
102
<B>colorspace</B>=<I>RGB</I>
104
<B>colorspace</B>=<I>CMYK</I>
106
the colorspace of the pixel data. The default is <I>RGB</I>.
108
<B>compression=</B><I>BZip</I></DT><DT>
109
<B>compression</B>=<I>RLE</I>
111
<B>compression</B>=<I>Zip</I>
113
the type of algorithm used to compress the image data. If this
114
keyword is not present, the image data is assumed to be
117
<B>delay</B> <I><1/100ths of a second></I>
119
the interframe delay in an image sequence. The maximum delay is
122
<B>depth</B>=<I>8</I>
124
<B>depth</B>=<I>16</I>
126
<B>depth</B>=<I>32</I></DT><DD>
127
depth of a single color value representing values from 0 to 255
128
(depth 8), 65535 (depth 16), or 4294967295 (depth 32). If this
129
keyword is absent, a depth of 8 is assumed.
131
<B>dispose</B> <I>value</I>
134
</DD><DD STYLE="margin-bottom: 0.2in">
135
Here are the valid methods:
137
<TABLE WIDTH=83% BORDER=1 CELLPADDING=4 CELLSPACING=3>
142
<TH WIDTH=16% BGCOLOR="#52799e">
145
<TH WIDTH=84% BGCOLOR="#52799e">
152
<TD WIDTH=16% VALIGN=BOTTOM SDVAL="0" SDNUM="1033;">
153
<P ALIGN=CENTER>0</P>
155
<TD WIDTH=84% VALIGN=TOP>
156
<P>No disposal specified.</P>
160
<TD WIDTH=16% VALIGN=BOTTOM SDVAL="1" SDNUM="1033;">
161
<P ALIGN=CENTER>1</P>
163
<TD WIDTH=84% VALIGN=TOP>
164
<P>Do not dispose between frames.</P>
168
<TD WIDTH=16% VALIGN=BOTTOM SDVAL="2" SDNUM="1033;">
169
<P ALIGN=CENTER>2</P>
171
<TD WIDTH=84% VALIGN=TOP>
172
<P>Overwrite frame with background color from header.</P>
176
<TD WIDTH=16% VALIGN=BOTTOM SDVAL="3" SDNUM="1033;">
177
<P ALIGN=CENTER>3</P>
179
<TD WIDTH=84% VALIGN=TOP>
180
<P>Overwrite with previous frame.</P>
185
<DT><B>gamma</B>=<I>value</I>
187
gamma of the image. If it is not specified, a gamma of 1.0 (linear
188
brightness response) is assumed,
190
<B>id</B>=<I>GraphicsMagick</I>
192
identify the file as a <B>MIFF</B>-format image file. This keyword
193
is required and has no default. Although this keyword can appear
194
anywhere in the header, it should start as the first keyword of the
195
header in column 1. This will allow programs like <I>file</I>(1) to
196
easily identify the file as <B>MIFF</B>.
198
<B>iterations</B> <I>value</I>
200
the number of times an image sequence loops before stopping.
202
<B>label</B>={<I>value</I>}
204
this optional keyword defines a short title or caption for the
205
image. If any whitespace appears in the label, it must be enclosed
206
within double quotes.
208
<B>matte</B>=<I>True</I>
210
<B>matte</B>=<I>False</I>
212
specifies whether a <I>DirectClass</I> image has matte data. Matte
213
data is generally useful for image compositing. This keyword has no
214
meaning for pseudocolor images.
216
<B>montage</B>=<I><width>x<height>{+-}<xoffset</I>>{+-}<<I>yoffset</I>>
218
size and location of the individual tiles of a composite image. See
219
<I>X(1)</I> for details about the geometry specification.
221
Use this keyword when the image is a composite of a number of
222
different tiles. A tile consists of an image and optionally a border
223
and a label. <<I>width</I>> is the size in pixels of each
224
individual tile in the horizontal direction and <<I>height</I>>
225
is the size in the vertical direction. Each tile must have an equal
226
number of pixels in width and equal in height. However, the width
227
can differ from the height. <<I>xoffset</I>> is the offset in
228
number of pixels from the vertical edge of the composite image where
229
the first tile of a row begins and <<I>yoffset</I>> is the
230
offset from the horizontal edge where the first tile of a column
233
If this keyword is specified, a directory of tile names must follow
234
the image header. The format of the directory is explained below.
236
<B>page</B>=<I><width>x<height>{+-}<xoffset</I>>{+-}<<I>yoffset</I>></DT><DD>
237
preferred size and location of an image canvas.
239
<B>profile-icc</B>=<I>value</I>
241
the number of bytes in the International Color Consortium color
242
profile. The profile is defined by the <EM>ICC profile
243
specification</EM>.</DD><DT>
244
<B>profile-iptc</B>=<I>value</I>
246
the number of bytes in the IPTC Newsphoto profile. The profile is
247
defined by the <I>IPTC</I><EM> <I>specification</I></EM>.</DD><DT>
248
<B>profile-<I>name</I></B>=<I>value</I></DT><DD STYLE="font-variant: normal; font-style: normal">
249
the number of bytes in the generic profile <I>name</I> where <I>name</I>
250
identifies the profile. <I>Name</I> is substituted with any LATIN-1
251
string to form a unique generic profile identifier.</DD><DT>
252
<B>red-primary</B>=<I>x,y</I>
254
<B>green-primary</B>=<I>x,y</I>
256
<B>blue-primary</B>=<I>x,y</I>
258
<B>white-point</B>=<I>x,y</I>
260
these optional keywords reflect the chromaticity primaries and white
263
<B>rendering-intent</B>=<I>saturation</I>
265
<B>rendering-intent</B>=<I>perceptual</I>
267
<B>rendering-intent</B>=<I>absolute</I>
269
<B>rendering-intent</B>=<I>relative</I>
271
Rendering intent is the CSS-1 property that has been defined by the
272
<A HREF="http://www.color.org/">International Color Consortium</A>.
274
<B>resolution</B>=<I><x-resolution>x<y-resolution></I>
276
vertical and horizontal resolution of the image. See <B>units</B>
277
for the specific resolution units (e.g. pixels per inch).
279
<B>rows</B>=<I>value</I>
281
the height of the image in pixels. This is a required keyword and
284
<B>scene</B>=<I>value</I>
286
the sequence number for this <B>MIFF</B> image file. This optional
287
keyword is used when a <B>MIFF</B> image file is one in a sequence
288
of files used in an animation.
290
<B>signature</B>=<I>value</I>
292
this optional keyword contains a string that uniquely identifies the
293
image pixel contents. NIST's SHA-256 message digest algorithm is
296
<B>units</B>=<I>pixels-per-inch</I>
298
<B>units</B>=<I>pixels-per-centimeter</I>
299
</DT><DD STYLE="margin-bottom: 0.2in">
300
image resolution units.
303
Other key value pairs are permitted. If a value contains whitespace
304
it must be enclosed with braces as illustrated here:
306
<PRE> id=GraphicsMagick
307
class=PseudoClass colors=256
309
columns=1280 rows=1024
311
signature=d79e1c308aa5bbcdeea8ed63df412da9
312
copyright={Copyright (c) 2000 GraphicsMagick Group}
315
Note that <I>keyword</I>=<I>value</I> combinations may be separated
316
by newlines or spaces and may occur in any order within the header.
317
Comments (within braces) may appear anywhere before the colon.
319
<P>The elements shown in the following table may appear after the
320
header and before the image data. These elements appear in the order
321
described in the following table if the keyword indicates that they
323
<TABLE WIDTH=100% BORDER=1 CELLPADDING=4 CELLSPACING=3>
329
<TH WIDTH=20% BGCOLOR="#52799e">
332
<TH WIDTH=20% BGCOLOR="#52799e">
335
<TH WIDTH=60% BGCOLOR="#52799e">
343
<P ALIGN=CENTER>Image directory</P>
346
<P ALIGN=CENTER><B>montage</B></P>
349
<P ALIGN=LEFT>The directory consists of a name for each tile of
350
the composite image separated by a <B>newline</B> character. The
351
list is terminated with a NULL character.</P>
356
<P ALIGN=CENTER>ICC Profile</P>
359
<P ALIGN=CENTER><B>profile-icc</B></P>
362
<P ALIGN=LEFT>Binary color profile.</P>
367
<P ALIGN=CENTER>IPTC Profile</P>
370
<P ALIGN=CENTER><B>profile-iptc</B></P>
373
<P ALIGN=LEFT>Binary IPTC Newsphoto profile.</P>
378
<P ALIGN=CENTER>Generic Profiles</P>
381
<P ALIGN=CENTER><B>profile-</B><<B>name</B>></P>
384
<P ALIGN=LEFT>Binary generic profile. Multiple named generic
385
profiles may exist.</P>
390
<P>Next comes the binary image data itself. How the image data is
391
formatted depends upon the class of the image as specified (or not
392
specified) by the value of the <B>class</B> keyword in the header.
393
All numeric values in the binary section are written with the most
394
significant bytes occuring first (big-endian ordering).</P>
395
<P><B>DirectClass</B> images (<TT>class=DirectClass</TT>) are
396
continuous-tone, images stored as RGB (red, green, blue), RGBA (red,
397
green, blue, alpha), CMYK (cyan, yellow, magenta, black), and CMYKA
398
(cyan, yellow, magenta, black, alpha) intensity values as defined by
399
the <B>colorspace</B> and <B>matte</B> keywords. The size of each
400
intensity value depends on the depth of the image. The depth, number
401
of bytes, and numeric range of each value are shown in the following
404
<TABLE WIDTH=55% BORDER=1 CELLPADDING=4 CELLSPACING=3>
410
<TH WIDTH=18% BGCOLOR="#52799e">
413
<TH WIDTH=43% BGCOLOR="#52799e">
414
<P>Bytes Per Value</P>
416
<TH WIDTH=39% BGCOLOR="#52799e">
423
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="8" SDNUM="1033;">
424
<P ALIGN=CENTER>8</P>
426
<TD WIDTH=43% VALIGN=BOTTOM SDVAL="1" SDNUM="1033;">
427
<P ALIGN=CENTER>1</P>
429
<TD WIDTH=39% VALIGN=TOP>
434
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="16" SDNUM="1033;">
435
<P ALIGN=CENTER>16</P>
437
<TD WIDTH=43% VALIGN=BOTTOM SDVAL="2" SDNUM="1033;">
438
<P ALIGN=CENTER>2</P>
440
<TD WIDTH=39% VALIGN=TOP>
445
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="32" SDNUM="1033;">
446
<P ALIGN=CENTER>32</P>
448
<TD WIDTH=43% VALIGN=BOTTOM SDVAL="4" SDNUM="1033;">
449
<P ALIGN=CENTER>4</P>
451
<TD WIDTH=39% VALIGN=TOP>
458
<P>The alpha value (if it occurs) represents the degree of pixel
459
opacity (zero is totally transparent).</P>
460
<P><B>PseudoClass</B> images (<TT>class=PseudoClass</TT>) are
461
colormapped <B>RGB</B> images. The colormap is stored as a series of
462
red, green, and blue pixel values. The size of each colormap value
463
depends on the image depth, as shown in the following table:</P>
465
<TABLE WIDTH=80% BORDER=1 CELLPADDING=4 CELLSPACING=3>
472
<TH WIDTH=18% BGCOLOR="#52799e">
475
<TH WIDTH=22% BGCOLOR="#52799e">
476
<P>Bytes Per Value</P>
478
<TH WIDTH=32% BGCOLOR="#52799e">
481
<TH WIDTH=28% BGCOLOR="#52799e">
482
<P>Bytes Per Colormap Entry</P>
488
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="8" SDNUM="1033;">
489
<P ALIGN=CENTER>8</P>
491
<TD WIDTH=22% VALIGN=BOTTOM SDVAL="1" SDNUM="1033;">
492
<P ALIGN=CENTER>1</P>
494
<TD WIDTH=32% VALIGN=TOP>
497
<TD WIDTH=28% VALIGN=BOTTOM SDVAL="3" SDNUM="1033;">
498
<P ALIGN=CENTER>3</P>
502
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="16" SDNUM="1033;">
503
<P ALIGN=CENTER>16</P>
505
<TD WIDTH=22% VALIGN=BOTTOM SDVAL="2" SDNUM="1033;">
506
<P ALIGN=CENTER>2</P>
508
<TD WIDTH=32% VALIGN=TOP>
511
<TD WIDTH=28% VALIGN=BOTTOM SDVAL="6" SDNUM="1033;">
512
<P ALIGN=CENTER>6</P>
516
<TD WIDTH=18% VALIGN=BOTTOM SDVAL="32" SDNUM="1033;">
517
<P ALIGN=CENTER>32</P>
519
<TD WIDTH=22% VALIGN=BOTTOM SDVAL="4" SDNUM="1033;">
520
<P ALIGN=CENTER>4</P>
522
<TD WIDTH=32% VALIGN=TOP>
525
<TD WIDTH=28% VALIGN=BOTTOM SDVAL="12" SDNUM="1033;">
526
<P ALIGN=CENTER>12</P>
532
<P>The number of colormap entries is defined by the <B>colors</B>
533
keyword. The colormap data occurs immediately following the header
534
(or image directory if the <B>montage</B> keyword is in the header).
535
Immediately following the colormap data is the <B>PseudoClass</B>
536
image data. <B>PseudoClass</B> image data is an array of index values
537
into the color map. The number of bytes comprising the index value
538
depends on the number of <B>colors</B> in the image. The following
539
table shows the number of bytes in each colormap index as determined
540
by the colors keyword:</P>
542
<TABLE WIDTH=72% BORDER=1 CELLPADDING=4 CELLSPACING=3>
548
<TH WIDTH=30% BGCOLOR="#52799e">
551
<TH WIDTH=31% BGCOLOR="#52799e">
552
<P>Bytes Per Index</P>
554
<TH WIDTH=39% BGCOLOR="#52799e">
561
<TD WIDTH=30% VALIGN=TOP>
562
<P ALIGN=CENTER><=256</P>
564
<TD WIDTH=31% VALIGN=BOTTOM SDVAL="1" SDNUM="1033;">
565
<P ALIGN=CENTER>1</P>
567
<TD WIDTH=39% VALIGN=TOP>
572
<TD WIDTH=30% VALIGN=TOP>
573
<P ALIGN=CENTER><=65535</P>
575
<TD WIDTH=31% VALIGN=BOTTOM SDVAL="2" SDNUM="1033;">
576
<P ALIGN=CENTER>2</P>
578
<TD WIDTH=39% VALIGN=TOP>
583
<TD WIDTH=30% VALIGN=TOP>
584
<P ALIGN=CENTER><=4294967295</P>
586
<TD WIDTH=31% VALIGN=BOTTOM SDVAL="4" SDNUM="1033;">
587
<P ALIGN=CENTER>4</P>
589
<TD WIDTH=39% VALIGN=TOP>
596
<P>If <B>matte</B> is true, each colormap index is immediately
597
followed by an equally-sized alpha value. The alpha value represents
598
the degree of pixel opacity (zero is totally transparent).</P>
599
<P>The image data in a <B>MIFF</B> file may be uncompressed,
600
runlength encoded, <A HREF="ftp://ftp.uu.net/graphics/png/src/">Zip</A>
601
compressed, or <A HREF="http://www.muraroa.demon.co.uk/">BZip</A>
602
compressed. The <B>compression</B> keyword in the header defines how
603
the image data is compressed. Uncompressed pixels are stored one
604
scanline at a time in row order. Runlength encoded compression counts
605
runs of identical adjacent pixels and stores the pixels followed by a
606
length byte (the number of identical pixels minus 1). Zip and BZip
607
compression compresses each row of an image and precedes the
608
compressed row with the length of compressed pixel bytes as a word in
609
most significant byte first order.
611
<P STYLE="margin-bottom: 0in"><A NAME="auth"></A><B>MIFF</B> files
612
may contain more than one image. Simply concatenate each individual
613
image (composed of a header and image data) into one file.
615
<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2>
617
<TD BGCOLOR="#52799e">
618
<P ALIGN=LEFT><IMG SRC="../images/right_triangle.png" NAME="Graphic3" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0><B><FONT FACE="Helvetica, Arial"><FONT COLOR="#ffffff">Authors</FONT></FONT></B></P>
622
<P STYLE="margin-bottom: 0in"><I>John Cristy</I>,
623
<A HREF="mailto:magick@imagemagick.org"><I>magick@imagemagick.org</I></A><B>GraphicsMagick
625
<P STYLE="margin-bottom: 0in"><A NAME="copy"></A><BR>
627
<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=2>
629
<TD BGCOLOR="#52799e">
630
<P ALIGN=LEFT><IMG SRC="../images/right_triangle.png" NAME="Graphic4" ALT=">" ALIGN=BOTTOM WIDTH=15 HEIGHT=14 BORDER=0><B><FONT FACE="Helvetica, Arial"><FONT COLOR="#ffffff">Copyright</FONT></FONT></B></P>
634
<P>Copyright (C) 2002 GraphicsMagick Group
636
<P>Permission is hereby granted, free of charge, to any person
637
obtaining a copy of this software and associated documentation files
638
("GraphicsMagick"), to deal in GraphicsMagick without
639
restriction, including without limitation the rights to use, copy,
640
modify, merge, publish, distribute, sublicense, and/or sell copies of
641
GraphicsMagick, and to permit persons to whom the GraphicsMagick is
642
furnished to do so, subject to the following conditions:
644
<P>The above copyright notice and this permission notice shall be
645
included in all copies or substantial portions of GraphicsMagick.
647
<P>The software is provided "as is", without warranty of
648
any kind, express or implied, including but not limited to the
649
warranties of merchantability, fitness for a particular purpose and
650
noninfringement.In no event shall GraphicsMagick Group be liable for
651
any claim, damages or other liability, whether in an action of
652
contract, tort or otherwise, arising from, out of or in connection
653
with GraphicsMagick or the use or other dealings in GraphicsMagick.
655
<P STYLE="margin-bottom: 0in">Except as contained in this notice, the
656
name of the GraphicsMagick Group shall not be used in advertising or
657
otherwise to promote the sale, use or other dealings in
658
GraphicsMagick without prior written authorization from the
659
GraphicsMagick Studio.
662
<P ALIGN=CENTER><A HREF="Copyright.html"><FONT SIZE=3>Copyright</FONT></A><FONT SIZE=3>
663
<FONT FACE="Abadi Mt Condensed Extra Bold">©</FONT>
664
GraphicsMagick Group 2002, 2003, 2004</FONT></P>
b'\\ No newline at end of file'