github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/miff.html (about) 1 <?xml version="1.0" encoding="utf-8" ?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6 <meta name="generator" content="Docutils 0.15.2: http://docutils.sourceforge.net/" /> 7 <title>Magick Image File Format (version 1.0)</title> 8 <link rel="stylesheet" href="docutils-articles.css" type="text/css" /> 9 </head> 10 <body> 11 12 <div class="banner"> 13 <img src="images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" /> 14 <span class="title">GraphicsMagick</span> 15 <form action="http://www.google.com/search"> 16 <input type="hidden" name="domains" value="www.graphicsmagick.org" /> 17 <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" /> 18 <span class="nowrap"><input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" /></span> 19 </form> 20 </div> 21 22 <div class="navmenu"> 23 <ul> 24 <li><a href="index.html">Home</a></li> 25 <li><a href="project.html">Project</a></li> 26 <li><a href="download.html">Download</a></li> 27 <li><a href="README.html">Install</a></li> 28 <li><a href="Hg.html">Source</a></li> 29 <li><a href="NEWS.html">News</a> </li> 30 <li><a href="utilities.html">Utilities</a></li> 31 <li><a href="programming.html">Programming</a></li> 32 <li><a href="reference.html">Reference</a></li> 33 </ul> 34 </div> 35 <div class="document" id="magick-image-file-format-version-1-0"> 36 <h1 class="title">Magick Image File Format (version 1.0)</h1> 37 38 <!-- -*- mode: rst -*- --> 39 <!-- This text is in reStucturedText format, so it may look a bit odd. --> 40 <!-- See http://docutils.sourceforge.net/rst.html for details. --> 41 <p>Magick Image File Format (MIFF) is a platform-independent format for 42 storing bitmap images. MIFF was originally invented by John Cristy for 43 ImageMagick, but is also a native format of GraphicsMagick. It is 44 useful as an efficient lossless working file format which assures that 45 all of the image attributes used by ImageMagick and GraphicsMagick are 46 preserved. Several lossless compression algorithms are available in 47 order to save space.</p> 48 <div class="section" id="description"> 49 <h1>Description</h1> 50 <p>A MIFF image file consist of two sections. The first section is a header 51 composed of keywords describing the image in text form. The next section 52 is the binary image data. The header is separated from the image data by 53 a : character immediately followed by a ctrl-Z.</p> 54 <p>The MIFF header is composed entirely of LATIN-1 characters. The fields in 55 the header are keyword and value combination in the keyword=value format, 56 with each keyword and value separated by an equal sign (=). Each 57 keyword=value combination is delimited by at least one control or 58 whitespace character. Comments may appear in the header section and are 59 always delimited by braces. The MIFF header always ends with a colon (:) 60 character, followed by a ctrl-Z character. It is also common to precede 61 the colon with a formfeed and a newline character. The formfeed prevents 62 the listing of binary data when using more(1) under Unix where the ctrl-Z 63 has the same effect with the type command on the Win32 command line.</p> 64 <p>It is required that the 'id' keyword be present with the value 65 'ImageMagick' (id=ImageMagick) and be the first keyword listed in the 66 MIFF header. Files not starting with this keyword/value may be 67 rejected. The 'version' keyword must always be emitted for all new 68 files with the value '1.0' (version=1.0).</p> 69 <p>The MIFF header supports arbitrary LATIN-1 keyword strings. Some 70 keyword strings have special interpretation while others are merely 71 stored as image attributes. The following is a list of keyword=value 72 combinations with special interpretation that may be found in a MIFF 73 file:</p> 74 <p>background-color=color</p> 75 <p>border-color=color</p> 76 <p>matte-color=color</p> 77 <blockquote> 78 these optional keywords reflects the image background, border, and 79 matte colors respectively. A color can be a name (e.g. white) or a hex 80 value (e.g. #ccc).</blockquote> 81 <p>class=DirectClass</p> 82 <p>class=PseudoClass</p> 83 <blockquote> 84 the type of binary image data stored in the MIFF file. If this keyword 85 is not present, DirectClass image data is assumed.</blockquote> 86 <p>colors=value</p> 87 <blockquote> 88 the number of colors in a DirectClass image. For a PseudoClass image, 89 this keyword specifies the size of the colormap. If this keyword is not 90 present in the header, and the image is PseudoClass, a linear 256 color 91 grayscale colormap is used with the image data. The maximum number of 92 colormap entries is 65535.</blockquote> 93 <p>columns=value</p> 94 <blockquote> 95 the width of the image in pixels. This is a required keyword and has no 96 default.</blockquote> 97 <p>colorspace=RGB</p> 98 <p>colorspace=CMYK</p> 99 <blockquote> 100 the colorspace of the pixel data. The default is RGB.</blockquote> 101 <p>comment={text}</p> 102 <blockquote> 103 comment text. Note that extremely old MIFF files used a different 104 means to indicate comment text.</blockquote> 105 <p>compression=BZip</p> 106 <p>compression=None</p> 107 <p>compression=RLE</p> 108 <p>compression=Zip</p> 109 <blockquote> 110 the type of algorithm used to compress the image data. If this keyword 111 is not present, the image data is assumed to be uncompressed.</blockquote> 112 <p>delay <1/100ths of a second></p> 113 <blockquote> 114 the interframe delay in an image sequence. The maximum delay is 65535.</blockquote> 115 <p>depth=8</p> 116 <p>depth=16</p> 117 <p>depth=32</p> 118 <blockquote> 119 depth of a single color value representing values from 0 to 255 120 (depth 8), 65535 (depth 16), or 4294967295 (depth 32). If this 121 keyword is absent, a depth of 8 is assumed. Depth values of 1 to 32 122 are accepted, with the storage depth being rounded up to 8, 16, 123 or 32.</blockquote> 124 <p>dispose value</p> 125 <blockquote> 126 <p>GIF disposal method. Here are the valid methods:</p> 127 <blockquote> 128 <table border="1" class="docutils"> 129 <colgroup> 130 <col width="19%" /> 131 <col width="81%" /> 132 </colgroup> 133 <tbody valign="top"> 134 <tr><td>Disposal</td> 135 <td>Description</td> 136 </tr> 137 <tr><td>0</td> 138 <td>No disposal specified.</td> 139 </tr> 140 <tr><td>1</td> 141 <td>Do not dispose between frames.</td> 142 </tr> 143 <tr><td>2</td> 144 <td>Overwrite frame with background color from 145 header.</td> 146 </tr> 147 <tr><td>3</td> 148 <td>Overwrite with previous frame.</td> 149 </tr> 150 </tbody> 151 </table> 152 </blockquote> 153 </blockquote> 154 <p>gamma=value</p> 155 <blockquote> 156 gamma of the image. If it is not specified, a gamma value of 157 .45454545 (linear-intensity gamma "2.2" as used by NTSC, sRGB, and 158 Rec.709) is assumed. A gamma value of 1.0 indicates linear-light.</blockquote> 159 <p>id=ImageMagick</p> 160 <blockquote> 161 identify the file as a MIFF-format image file. This keyword is required 162 and has no default. Although this keyword can appear anywhere in the 163 header, it should start as the first keyword of the header in column 1. 164 This will allow programs like file(1) to easily identify the file as 165 MIFF.</blockquote> 166 <p>iterations value</p> 167 <blockquote> 168 the number of times an image sequence loops before stopping.</blockquote> 169 <p>label={value}</p> 170 <blockquote> 171 this optional keyword defines a short title or caption for the image. 172 If any whitespace appears in the label, it must be enclosed within 173 double quotes.</blockquote> 174 <p>matte=True</p> 175 <p>matte=False</p> 176 <blockquote> 177 specifies whether a DirectClass image has matte data. Matte data is 178 generally useful for image compositing. This keyword has no meaning for 179 pseudocolor images.</blockquote> 180 <p>montage=<width>x<height>{+-}<xoffset>{+-}<yoffset></p> 181 <blockquote> 182 size and location of the individual tiles of a composite image. See 183 X(1) for details about the geometry specification. Use this keyword 184 when the image is a composite of a number of different tiles. A tile 185 consists of an image and optionally a border and a label. < width> is 186 the size in pixels of each individual tile in the horizontal direction 187 and <height> is the size in the vertical direction. Each tile must have 188 an equal number of pixels in width and equal in height. However, the 189 width can differ from the height. <xoffset> is the offset in number of 190 pixels from the vertical edge of the composite image where the first 191 tile of a row begins and <yoffset> is the offset from the horizontal 192 edge where the first tile of a column begins. If this keyword is 193 specified, a directory of tile names must follow the image header. The 194 format of the directory is explained below.</blockquote> 195 <p>page=<width>x<height>{+-}<xoffset>{+-}<yoffset></p> 196 <blockquote> 197 preferred size and location of an image canvas.</blockquote> 198 <p>profile-icc=value</p> 199 <blockquote> 200 the number of bytes in the International Color Consortium color 201 profile. The profile is defined by the ICC profile specification.</blockquote> 202 <p>profile-iptc=value</p> 203 <blockquote> 204 the number of bytes in the IPTC Newsphoto profile. The profile is 205 defined by the IPTC specification.</blockquote> 206 <p>profile-name=value</p> 207 <blockquote> 208 the number of bytes in the generic profile name where name identifies 209 the profile. Name is substituted with any LATIN-1 string to form a 210 unique generic profile identifier.</blockquote> 211 <p>profile:name=value</p> 212 <blockquote> 213 the number of bytes in the generic profile name where name identifies 214 the profile. Name is substituted with any LATIN-1 string to form a 215 unique generic profile identifier.</blockquote> 216 <p>red-primary=x,y</p> 217 <p>green-primary=x,y</p> 218 <p>blue-primary=x,y</p> 219 <p>white-point=x,y</p> 220 <blockquote> 221 these optional keywords reflect the chromaticity primaries and white point.</blockquote> 222 <p>rendering-intent=saturation</p> 223 <p>rendering-intent=perceptual</p> 224 <p>rendering-intent=absolute</p> 225 <p>rendering-intent=relative</p> 226 <blockquote> 227 Rendering intent is the CSS-1 property that has been defined by the 228 International Color Consortium.</blockquote> 229 <p>resolution=<x-resolution>x<y-resolution></p> 230 <blockquote> 231 vertical and horizontal resolution of the image. See units for the 232 specific resolution units (e.g. pixels per inch).</blockquote> 233 <p>rows=value</p> 234 <blockquote> 235 the height of the image in pixels. This is a required keyword and has 236 no default.</blockquote> 237 <p>orientation=value</p> 238 <blockquote> 239 specifies the orientation of the image as an attribute (does not 240 effect pixel storage). Supported values are TopLeft, TopRight, 241 BottomRight, BottomLeft, LeftTop, RightTop, RightBottom, LeftBottom 242 as specified by the TIFF and EXIF standards.</blockquote> 243 <p>scene=value</p> 244 <blockquote> 245 the sequence number for this MIFF image file. This optional keyword is 246 used when a MIFF image file is one in a sequence of files used in an 247 animation.</blockquote> 248 <p>signature=value</p> 249 <blockquote> 250 this optional keyword contains a string that uniquely identifies the 251 image pixel contents. NIST's SHA-256 message digest algorithm is 252 recommended.</blockquote> 253 <p>units=pixels-per-inch</p> 254 <p>units=pixels-per-centimeter</p> 255 <blockquote> 256 image resolution units.</blockquote> 257 <p>version=1.0</p> 258 <blockquote> 259 Identifies the MIFF version used, which is 1.0 for the purpose of 260 this specification. If version is omitted, then certain MIFF 261 features (e.g. compressed rows) are assumed to be encoded using a 262 defunct MIFF format.</blockquote> 263 <p>Other key value pairs are permitted. If a value contains whitespace it must be 264 enclosed with braces as illustrated here:</p> 265 <pre class="literal-block"> 266 id=ImageMagick version=1.0 267 class=PseudoClass colors=256 268 compression=RLE 269 columns=1280 rows=1024 270 scene=1 271 signature=d79e1c308aa5bbcdeea8ed63df412da9 272 copyright={Copyright (c) 2000 Mortimer Snerd} 273 <FF> 274 : 275 </pre> 276 <p>Note that keyword=value combinations may be separated by newlines or 277 spaces and may occur in any order within the header. Comments (within 278 braces) may appear anywhere before the colon.</p> 279 <p>The elements shown in the following table may appear after the header and 280 before the image data. These elements appear in the order described in 281 the following table if the keyword indicates that they exist.</p> 282 <table border="1" class="docutils"> 283 <colgroup> 284 <col width="21%" /> 285 <col width="21%" /> 286 <col width="57%" /> 287 </colgroup> 288 <tbody valign="top"> 289 <tr><td>Element</td> 290 <td>Keyword</td> 291 <td>Description</td> 292 </tr> 293 <tr><td>Image 294 directory</td> 295 <td>montage</td> 296 <td>The directory consists of a name for each 297 tile of the composite image separated by 298 a newline character. The list is 299 terminated with a NULL character.</td> 300 </tr> 301 <tr><td>ICC Profile</td> 302 <td>profile-icc</td> 303 <td>Binary color profile.</td> 304 </tr> 305 <tr><td>IPTC Profile</td> 306 <td>profile-iptc</td> 307 <td>Binary IPTC Newsphoto profile.</td> 308 </tr> 309 <tr><td>Generic 310 Profiles</td> 311 <td>profile-<name></td> 312 <td>Binary generic profile. Multiple named 313 generic profiles may exist.</td> 314 </tr> 315 </tbody> 316 </table> 317 <p>Next comes the binary image data itself. How the image data is formatted 318 depends upon the class of the image as specified (or not specified) by 319 the value of the class keyword in the header. All numeric values in the 320 binary section are written with the most significant bytes occuring first 321 (big-endian ordering).</p> 322 <p>DirectClass images (class=DirectClass) are continuous-tone, images stored 323 as RGB (red, green, blue), RGBA (red, green, blue, alpha), CMYK (cyan, 324 yellow, magenta, black), and CMYKA (cyan, yellow, magenta, black, alpha) 325 intensity values as defined by the colorspace and matte keywords. The 326 size of each intensity value depends on the depth of the image. The 327 depth, number of bytes, and numeric range of each value are shown in the 328 following table:</p> 329 <blockquote> 330 <table border="1" class="docutils"> 331 <colgroup> 332 <col width="21%" /> 333 <col width="41%" /> 334 <col width="38%" /> 335 </colgroup> 336 <tbody valign="top"> 337 <tr><td>Depth</td> 338 <td>Bytes Per 339 Value</td> 340 <td>Value Range</td> 341 </tr> 342 <tr><td>8</td> 343 <td>1</td> 344 <td>0..255</td> 345 </tr> 346 <tr><td>16</td> 347 <td>2</td> 348 <td>0..65535</td> 349 </tr> 350 <tr><td>32</td> 351 <td>4</td> 352 <td>0..4294967295</td> 353 </tr> 354 </tbody> 355 </table> 356 </blockquote> 357 <p>The alpha value (if it occurs) represents the degree of pixel opacity 358 (zero is totally transparent).</p> 359 <p>PseudoClass images (class=PseudoClass) are colormapped RGB images. The 360 colormap is stored as a series of red, green, and blue pixel values. The 361 size of each colormap value depends on the image depth, as shown in the 362 following table:</p> 363 <blockquote> 364 <table border="1" class="docutils"> 365 <colgroup> 366 <col width="19%" /> 367 <col width="22%" /> 368 <col width="31%" /> 369 <col width="28%" /> 370 </colgroup> 371 <tbody valign="top"> 372 <tr><td>Depth</td> 373 <td>Bytes Per 374 Value</td> 375 <td>Value Range</td> 376 <td>Bytes Per 377 Colormap Entry</td> 378 </tr> 379 <tr><td>8</td> 380 <td>1</td> 381 <td>0..255</td> 382 <td>3</td> 383 </tr> 384 <tr><td>16</td> 385 <td>2</td> 386 <td>0..65535</td> 387 <td>6</td> 388 </tr> 389 <tr><td>32</td> 390 <td>4</td> 391 <td>0..4294967295</td> 392 <td>12</td> 393 </tr> 394 </tbody> 395 </table> 396 </blockquote> 397 <p>The number of colormap entries is defined by the colors keyword. The 398 colormap data occurs immediately following the header (or image directory 399 if the montage keyword is in the header). Immediately following the 400 colormap data is the PseudoClass image data. PseudoClass image data is an 401 array of index values into the color map. The number of bytes comprising 402 the index value depends on the number of colors in the image. The 403 following table shows the number of bytes in each colormap index as 404 determined by the colors keyword:</p> 405 <blockquote> 406 <table border="1" class="docutils"> 407 <colgroup> 408 <col width="31%" /> 409 <col width="31%" /> 410 <col width="38%" /> 411 </colgroup> 412 <tbody valign="top"> 413 <tr><td>Colors</td> 414 <td>Bytes Per 415 Index</td> 416 <td>Index Range</td> 417 </tr> 418 <tr><td><=256</td> 419 <td>1</td> 420 <td>0..255</td> 421 </tr> 422 <tr><td><=65535</td> 423 <td>2</td> 424 <td>0..65535</td> 425 </tr> 426 <tr><td><=4294967295</td> 427 <td>4</td> 428 <td>0..4294967295</td> 429 </tr> 430 </tbody> 431 </table> 432 </blockquote> 433 <p>If matte is true, each colormap index is immediately followed by an 434 equally-sized alpha value. The alpha value represents the degree of pixel 435 opacity (zero is totally transparent).</p> 436 <p>The image data in a MIFF file may be uncompressed, runlength encoded, 437 Zip compressed, or BZip compressed. The compression keyword in the 438 header defines how the image data is compressed. Uncompressed pixels 439 are stored one scanline at a time in row order. Runlength encoded 440 compression counts runs of identical adjacent pixels and stores the 441 pixels followed by a length byte (the number of identical pixels minus 442 1). Zip and BZip compression for version 1.0 compresses each row of an 443 image and precedes the compressed row with the length of compressed 444 pixel bytes as a 32-bit unsigned value in most significant byte first 445 order. If the version tag is not present (indicating a virtually 446 unused legacy format) then Zip and BZip omit this length value and the 447 reader must incrementally decode each row and restart compression at 448 the point where decoding completed for the previous row.</p> 449 <p>Note that compression in MIFF is scanline-based without any 450 specialized pre-processing as is found in the PNG and TIFF file 451 formats. As a result, available compression levels are likely to be 452 less than some other file formats given the same compression algorithm.</p> 453 <p>MIFF files may contain more than one image. Simply concatenate each 454 individual image (composed of a header and image data) into one file.</p> 455 </div> 456 <div class="section" id="authors"> 457 <h1>Authors</h1> 458 <p>John Cristy, <a class="reference external" href="mailto:magick-users%40imagemagick.org">magick-users<span>@</span>imagemagick<span>.</span>org</a> ImageMagick Studio LLC.</p> 459 <p>Maintained since 2002 by Bob Friesenhahn, GraphicsMagick Group.</p> 460 <hr class="docutils" /> 461 <p>Copyright © GraphicsMagick Group 2002 - 2020</p> 462 </div> 463 </div> 464 </body> 465 </html>