blob: 9cff788dbb3bbeb1873e4e06b2e8f23ef5f78e43 [file] [log] [blame]
cristy417eeb12013-07-28 18:48:22 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
cristyad41c0c2012-10-31 00:49:28 +00003<head>
cristy417eeb12013-07-28 18:48:22 +00004 <meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
5 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"></meta>
cristyffb69ed2010-12-25 00:06:48 +00006 <title>ImageMagick: Magick Image File Format</title>
cristy417eeb12013-07-28 18:48:22 +00007 <meta http-equiv="content-language" content="en-US"></meta>
8 <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
9 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"></meta>
10 <meta name="application-name" content="ImageMagick"></meta>
11 <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition, resize, rotate, shear, distort or transform images automagically."></meta>
12 <meta name="application-url" content="http://www.imagemagick.org"></meta>
13 <meta name="generator" content="PHP"></meta>
14 <meta name="keywords" content="magick, image, file, format, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"></meta>
15 <meta name="rating" content="GENERAL"></meta>
16 <meta name="robots" content="INDEX, FOLLOW"></meta>
17 <meta name="generator" content="ImageMagick Studio LLC"></meta>
18 <meta name="author" content="ImageMagick Studio LLC"></meta>
19 <meta name="revisit-after" content="2 DAYS"></meta>
20 <meta name="resource-type" content="document"></meta>
21 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"></meta>
22 <meta name="distribution" content="Global"></meta>
23 <link rel="icon" href="../images/wand.png"></link>
24 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"></link>
cristy149d58c2013-08-07 19:44:54 +000025 <link rel="canonical" href="../index.html"></link>
cristy417eeb12013-07-28 18:48:22 +000026 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"></link>
cristy8ee7f242013-06-20 16:08:44 +000027
cristyad41c0c2012-10-31 00:49:28 +000028 <!-- Add jQuery library -->
cristy417eeb12013-07-28 18:48:22 +000029 <script type="text/javascript" src="http://localhost/ajax/libs/jquery/1.7/jquery.min.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000030
cristy8ee7f242013-06-20 16:08:44 +000031 <!-- Add mousewheel plugin (this is optional) -->
32 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
cristyad41c0c2012-10-31 00:49:28 +000033
34 <!-- Add fancyBox -->
cristy417eeb12013-07-28 18:48:22 +000035 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000036 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
cristyad41c0c2012-10-31 00:49:28 +000037
cristy8ee7f242013-06-20 16:08:44 +000038 <!-- Optionally add helpers - button, thumbnail and/or media -->
cristy417eeb12013-07-28 18:48:22 +000039 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000040 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
41 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
cristyad41c0c2012-10-31 00:49:28 +000042
cristy417eeb12013-07-28 18:48:22 +000043 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen"></link>
cristy8ee7f242013-06-20 16:08:44 +000044 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
45
cristyad41c0c2012-10-31 00:49:28 +000046 <script type="text/javascript">
47 $(document).ready(function() {
48 $(".fancybox").fancybox();
49 });
50 </script>
cristy8ee7f242013-06-20 16:08:44 +000051
cristyad41c0c2012-10-31 00:49:28 +000052 <!-- ImageMagick style -->
cristyad41c0c2012-10-31 00:49:28 +000053 <style type="text/css" media="all">
54 @import url("../www/magick.css");
55 </style>
56</head>
57
58<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000059
cristy8ee7f242013-06-20 16:08:44 +000060
cristy8ee7f242013-06-20 16:08:44 +000061
cristyad41c0c2012-10-31 00:49:28 +000062<div class="titlebar">
63<div style="margin: 17px auto; float: left;">
64 <script type="text/javascript">
65 <!--
66 google_ad_client = "pub-3129977114552745";
67 google_ad_slot = "5439289906";
68 google_ad_width = 728;
69 google_ad_height = 90;
70 //-->
71 </script>
cristy417eeb12013-07-28 18:48:22 +000072
cristyad41c0c2012-10-31 00:49:28 +000073</div>
cristy149d58c2013-08-07 19:44:54 +000074<a href="../discourse-server">
cristy417eeb12013-07-28 18:48:22 +000075 <img src="../images/logo.jpg" alt="ImageMagick Logo" style="width: 123px; height: 118px; border: 0px; float: right;"></img></a>
cristyad41c0c2012-10-31 00:49:28 +000076<a href="../index.html">
cristy417eeb12013-07-28 18:48:22 +000077 <img src="../images/sprite.jpg" alt="ImageMagick Sprite" style="width: 114px; height: 118px; border: 0px; float: right;"></img></a>
cristyad41c0c2012-10-31 00:49:28 +000078</div>
79
80<div class="westbar">
81
cristy3ed852e2009-09-05 21:47:34 +000082<div class="menu">
cristy83a272e2010-05-07 20:40:35 +000083 <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
cristy3ed852e2009-09-05 21:47:34 +000084</div>
cristy3ed852e2009-09-05 21:47:34 +000085<div class="menu">
cristy751980d2012-06-03 23:18:35 +000086 <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
cristybb503372010-05-27 20:51:26 +000087</div>
88<div class="sub">
cristy751980d2012-06-03 23:18:35 +000089 <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
cristybb503372010-05-27 20:51:26 +000090</div>
91<div class="sub">
cristy751980d2012-06-03 23:18:35 +000092 <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
cristybb503372010-05-27 20:51:26 +000093</div>
94<div class="sub">
cristy751980d2012-06-03 23:18:35 +000095 <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
cristyda16f162011-02-19 23:52:17 +000096</div>
97<div class="sub">
cristy751980d2012-06-03 23:18:35 +000098 <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
cristybb503372010-05-27 20:51:26 +000099</div>
cristyad41c0c2012-10-31 00:49:28 +0000100<div class="sep"></div>
cristybb503372010-05-27 20:51:26 +0000101<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000102 <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
cristy3ed852e2009-09-05 21:47:34 +0000103</div>
104<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000105 <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
cristy3ed852e2009-09-05 21:47:34 +0000106</div>
107<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000108 <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
cristy3ed852e2009-09-05 21:47:34 +0000109</div>
110<div class="sub">
cristy83a272e2010-05-07 20:40:35 +0000111 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
cristy3ed852e2009-09-05 21:47:34 +0000112</div>
113<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000114 <a title="Program Interfaces" href="api.html">Program Interfaces</a>
cristy3ed852e2009-09-05 21:47:34 +0000115</div>
116<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000117 <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
cristy3ed852e2009-09-05 21:47:34 +0000118</div>
119<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000120 <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
cristy3ed852e2009-09-05 21:47:34 +0000121</div>
122<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000123 <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
cristy3ed852e2009-09-05 21:47:34 +0000124</div>
125<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000126 <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
cristy3ed852e2009-09-05 21:47:34 +0000127</div>
cristyad41c0c2012-10-31 00:49:28 +0000128<div class="sep"></div>
cristy417eeb12013-07-28 18:48:22 +0000129<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000130 <a title="Install from Source" href="install-source.html">Install from Source</a>
cristy3ed852e2009-09-05 21:47:34 +0000131</div>
132<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000133 <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
cristy3ed852e2009-09-05 21:47:34 +0000134</div>
135<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000136 <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
cristy3ed852e2009-09-05 21:47:34 +0000137 </div>
138<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000139 <a title="Resources" href="resources.html">Resources</a>
cristy3ed852e2009-09-05 21:47:34 +0000140</div>
cristybb503372010-05-27 20:51:26 +0000141<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000142 <a title="Architecture" href="architecture.html">Architecture</a>
cristybb503372010-05-27 20:51:26 +0000143</div>
cristy3ed852e2009-09-05 21:47:34 +0000144<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000145 <a title="Download" href="download.html">Download</a>
cristy3ed852e2009-09-05 21:47:34 +0000146</div>
cristyad41c0c2012-10-31 00:49:28 +0000147<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000148<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000149 <a title="Search" href="search.html">Search</a>
cristy3ed852e2009-09-05 21:47:34 +0000150</div>
cristyad41c0c2012-10-31 00:49:28 +0000151<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000152<div class="menu">
cristy751980d2012-06-03 23:18:35 +0000153 <a title="Site Map" href="sitemap.html">Site Map</a>
cristy3ed852e2009-09-05 21:47:34 +0000154</div>
cristy417eeb12013-07-28 18:48:22 +0000155<div class="sub">
cristy751980d2012-06-03 23:18:35 +0000156 <a title="Site Map: Links" href="links.html">Links</a>
cristy3ed852e2009-09-05 21:47:34 +0000157</div>
cristyad41c0c2012-10-31 00:49:28 +0000158<div class="sep"></div>
cristyeed6cb62012-01-28 19:38:34 +0000159<div class="menu">
cristy8ee7f242013-06-20 16:08:44 +0000160 <a title="Support ImageMagick Development" href="support.html">Support ImageMagick Development</a>
cristy3ed852e2009-09-05 21:47:34 +0000161</div>
cristyad41c0c2012-10-31 00:49:28 +0000162</div>
163
164<div class="eastbar">
cristy417eeb12013-07-28 18:48:22 +0000165
cristy149d58c2013-08-07 19:44:54 +0000166 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../index.html"></a></div>
cristy8ee7f242013-06-20 16:08:44 +0000167 <noscript>
168 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
cristy417eeb12013-07-28 18:48:22 +0000169 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0"></img></a>
cristy8ee7f242013-06-20 16:08:44 +0000170 </noscript>
cristy417eeb12013-07-28 18:48:22 +0000171
172
cristyad41c0c2012-10-31 00:49:28 +0000173</div>
174
175<div class="main">
176
cristyffb69ed2010-12-25 00:06:48 +0000177<h1>ImageMagick Magick Image File Format</h1>
cristy417eeb12013-07-28 18:48:22 +0000178<p class="navigation-index">[<a href="miff.html#miff-header">MIFF Header</a><a href="miff.html#binary">MIFF Binary Data</a>]</p>
cristy3ed852e2009-09-05 21:47:34 +0000179
180<div class="doc-section">
181<p>The Magick Image File Format (MIFF) is ImageMagick's own platform-independent format for storing bitmap images. It has an advantage over other image formats in that it stores all metadata known to ImageMagick (e.g. image color profiles, comments, author, copyright, etc.), whereas, other formats may only support a small portion of available metadata or none at all. 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. We discuss these sections in detail below.</p>
182</div>
183
cristydcca3fa2010-12-29 21:50:07 +0000184<h2><a id="miff-header"></a>MIFF Header</h2>
cristy3ed852e2009-09-05 21:47:34 +0000185<div class="doc-section">
186
187
cristy8ee7f242013-06-20 16:08:44 +0000188<p>The MIFF header is composed entirely of ISO-8859-1 characters. The fields in the header are key and value combination in the <em>key = value</em> format, with each key and value separated by an equal sign (<code>=</code>). Each <em>key = value</em> 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 (<code>:</code>) character, followed by a <em>ctrl-Z</em> character. It is also common to proceed the colon with a <em>formfeed</em> and a <em>newline</em> character. The <em>formfeed</em> prevents the listing of binary data when using the <code>more</code> Unix program, whereas, the <em>ctrl-Z</em> has the same effect with the <code>type</code> command on the Windows command line.</p>
cristy3ed852e2009-09-05 21:47:34 +0000189
190<p>The following is a partial list of <em> key = value</em> combinations that are typically be found in a MIFF file:</p>
191
192<dl class="doc">
193<dt class="doc">background-color = <em class="option">color</em></dt>
194<dt class="doc">border-color = <em class="option">color</em></dt>
195<dt class="doc">matte-color = <em class="option">color</em></dt>
cristy751980d2012-06-03 23:18:35 +0000196 <dd>these optional keys reflect the image background, border, and matte colors respectively. A <a href="color.html">color</a> can be a name (e.g. white) or a hex value (e.g. #ccc).</dd>
cristy3ed852e2009-09-05 21:47:34 +0000197<dt class="doc">class = DirectClass</dt>
198<dt class="doc">class = PseudoClass</dt>
199 <dd>the type of binary pixel data stored in the MIFF file. If this key is not present, DirectClass pixel data is assumed.</dd>
200<dt class="doc">colors = <em class="option"> value</em></dt>
201 <dd>the number of colors in a DirectClass image. For a PseudoClass image, this key specifies the number of entires in the colormap. If this key is not present in the header, and the image is PseudoClass, a linear 256 color grayscale colormap is assumed. The maximum number of colormap entries is 65536.</dd>
202<dt class="doc">colorspace = RGB</dt>
203<dt class="doc">colorspace = CMYK</dt>
204 <dd>the colorspace of the pixel data. The default is RGB.</dd>
205<dt class="doc">columns = value</dt>
206 <dd>the width of the image in pixels. This a required key and has no default value.</dd>
207<dt class="doc">compression = BZip</dt>
208<dt class="doc">compression = Fax</dt>
209<dt class="doc">compression = None</dt>
210<dt class="doc">compression = RLE</dt>
211<dt class="doc">compression = Zip</dt>
212 <dd>the type of algorithm used to compress the image data. If this key is not present, the pixel data is assumed to be uncompressed.</dd>
213<dt class="doc">delay = <em class="option">microseconds</em></dt>
214 <dd>the interframe delay in an image sequence in microseconds.</dd>
215<dt class="doc">depth = 8</dt>
216<dt class="doc">depth = 16</dt>
217<dt class="doc">depth = 32</dt>
218 <dd>the depth of a single color value representing values from 0 to 255 (depth 8), 0 - 65535 (depth 16), or 0 - 4294967295 (depth 32). If this key is absent, a depth of 8 is assumed.</dd>
219<dt class="doc">dispose = <em class="option">value</em></dt>
220 <dd>layer disposal method.</dd>
221 <dd>Here are the valid values:
222
223 <dl>
224 <dd>0. No disposal specified.</dd>
225 <dd>1. Do not dispose between frames.</dd>
226 <dd>2. Overwrite frame with background color from header.</dd>
227 <dd>3. Overwrite with previous frame.</dd>
228 </dl>
229</dd>
230
231<dt class="doc">gamma = <em class="option">value</em></dt>
232 <dd>the gamma of the image. If it is not specified, a gamma of 1.0 (linear brightness response) is assumed.</dd>
233
234<dt class="doc">id = ImageMagick</dt>
cristy8ee7f242013-06-20 16:08:44 +0000235 <dd>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 <code>file</code>(1) to easily identify the file as MIFF.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000236
237<dt class="doc">iterations = <em class="option">value</em></dt>
238 <dd>the number of times an image sequence loops before stopping.</dd>
239
240<dt class="doc">label = { <em class="option">string </em>]</dt>
241 <dd>defines a short title or caption for the image. If any whitespace appears in the label, it must be enclosed within braces.</dd>
242
243<dt class="doc">matte = True</dt>
244<dt class="doc">matte = False</dt>
245 <dd>specifies whether a the image has matte data. Matte data is generally useful for image compositing.</dd>
246
247<dt class="doc">montage = <em class="option">&lt;width&gt;x&lt;height&gt;[+-]&lt;x offset&gt;[+-]&lt;y offset&gt;</em></dt>
248 <dd>size and location of the individual tiles of a composite image.</dd>
249
250 <dd>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. <em>Width</em> is the size in pixels of each individual tile in the horizontal direction and <em>height</em> 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. <em>X offset</em> is the offset in number of pixels from the vertical edge of the composite image where the first tile of a row begins and <em>y offset</em> is the offset from the horizontal edge where the first tile of a column begins.</dd>
251
252 <dd>If this key is specified, a directory of tile names must follow the image header. The format of the directory is explained below.</dd>
253
254<dt class="doc">page = <em class="option">value</em></dt>
255 <dd>preferred size and location of an image canvas.</dd>
256
257<dt class="doc">profile-icc = <em class="option">value</em></dt>
258 <dd>the number of bytes in the International Color Consortium color profile. The profile is defined by the ICC profile specification located at <a href="http://www.color.org/icc_specs2.html">http://www.color.org/icc_specs2.html</a>.</dd>
259
260<dt class="doc">red-primary = <em class="option">x,y</em></dt>
261<dt class="doc">green-primary = <em class="option">x,y</em></dt>
262<dt class="doc">blue-primary = <em class="option">x,y</em></dt>
263<dt class="doc">white-point = <em class="option">x,y</em></dt>
264 <dd>this optional key reflects the chromaticity primaries and white point.</dd>
265
266<dt class="doc">rendering-intent = <em class="option">saturation</em></dt>
267<dt class="doc">rendering-intent = <em class="option">perceptual</em></dt>
268<dt class="doc">rendering-intent = <em class="option">absolute</em></dt>
269<dt class="doc">rendering-intent = <em class="option">relative</em></dt>
270 <dd>Rendering intent is the CSS-1 property that has been defined by the International Color Consortium (<a href="http://www.color.org">http://www.color.org</a>).</dd>
271
272<dt class="doc">resolution = <em class="option">&lt;x-resolution&gt;x&lt;y-resolution&gt;</em></dt>
273 <dd>vertical and horizontal resolution of the image. See units for the specific resolution units (e.g. pixels per inch).</dd>
274
275<dt class="doc">rows = <em class="option">value</em></dt>
276 <dd>the height of the image in pixels. This a required key and has no default value.</dd>
277
278<dt class="doc">scene = <em class="option">value</em></dt>
279 <dd>the sequence number for this MIFF image file. This optional key is useful when a MIFF image file is one in a sequence of files used in an animation.</dd>
280
281<dt class="doc">signature = <em class="option">value</em></dt>
282 <dd>this optional key contains a string that uniquely identifies the image pixel contents. NIST's SHA-256 message digest algorithm is recommended.</dd>
283
284<dt class="doc">units = pixels-per-inch</dt>
285<dt class="doc">units = pixels-per-centimeter</dt>
286 <dd>image resolution units.</dd>
287</dl>
288
289<p>Other key value pairs are permitted. If a value contains whitespace it must be enclosed with braces as illustrated here:</p>
290
291<pre class="text">
292 id=ImageMagick
293 class=PseudoClass colors=256 matte=False
294 columns=1280 rows=1024 depth=8
295 compression=RLE
296 colorspace=RGB
cristy8ee7f242013-06-20 16:08:44 +0000297 copyright={Copyright (c) 1999-2013 ImageMagick Studio LLC}
cristy417eeb12013-07-28 18:48:22 +0000298
cristy3ed852e2009-09-05 21:47:34 +0000299</pre>
300
301<p>Note that <em>key = value</em> combinations may be separated by <em>newlines</em> or spaces and may occur in any order within the header. Comments (within braces) may appear anywhere before the colon.</p>
302
303<p>If you specify the montage 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 <em>newline</em> character. The list is terminated with a NULL character.</p>
304
305<p>If you specify the color-profile key in the header, follow the header (or montage directory if the montage key is in the header) with the binary color profile.</p>
306
cristy8ee7f242013-06-20 16:08:44 +0000307<p>The header is separated from the image data by a <code>:</code> character immediately followed by a <em>newline</em>.</p>
cristy3ed852e2009-09-05 21:47:34 +0000308
309</div>
310
cristydcca3fa2010-12-29 21:50:07 +0000311<h2><a id="binary"></a>MIFF Binary Data</h2>
cristy3ed852e2009-09-05 21:47:34 +0000312<div class="doc-section">
313
314<p>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 class key in the header.</p>
315
316<p>DirectClass images are continuous-tone, images stored as RGB (red, green, blue), RGBA (red, green, blue, alpha), CMYK (cyan, yellow, magenta, black), or CMYKA (cyan, yellow, magenta, black, alpha) intensity values as defined by the colorspace key. Each intensity value is one byte in length for images of depth 8 (0..255), two bytes for a depth of 16 (0..65535), and images of depth 32 (0..4294967295) require four bytes in most significant byte first order.</p>
317
318<p>PseudoClass images 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
319or 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.</p>
320
321<p>The image pixel 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 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 precedes the compressed row with the length of compressed pixel bytes as a word in most significant byte first order.</p>
322
323<p>MIFF files may contain more than one image. Simply concatenate each individual image (composed of a header and image data) into one file.</p>
324
325</div>
cristyad41c0c2012-10-31 00:49:28 +0000326
327</div>
328
329<div id="linkbar">
cristyac1b4322013-07-28 13:58:06 +0000330 <span id="linkbar-west"> </span>
cristy8ee7f242013-06-20 16:08:44 +0000331
cristyad41c0c2012-10-31 00:49:28 +0000332 <span id="linkbar-center">
cristy149d58c2013-08-07 19:44:54 +0000333 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
334 <a href="../discourse-server">Discourse Server</a>
cristy417eeb12013-07-28 18:48:22 +0000335 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
cristy8ee7f242013-06-20 16:08:44 +0000336 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristyad41c0c2012-10-31 00:49:28 +0000337 </span>
cristyac1b4322013-07-28 13:58:06 +0000338 <span id="linkbar-east"> </span>
cristy149d58c2013-08-07 19:44:54 +0000339</div>
340<div class="footer">
341 <span id="footer-west">© 1999-2013 ImageMagick Studio LLC</span>
342 <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
343</div>
344<div style="clear: both; margin: 0; width: 100%; "></div>
cristyad41c0c2012-10-31 00:49:28 +0000345</body>
346</html>