1E . ImageMagick - MIFF File FormatB 2 2 2 : $  S<8 u

C

Magick Image File Format (MIFF) is a platform-independent>format for storing bitmap images. MIFF is a part of the>ImageMagick toolkit of imageImanipulation utilities for the X Window System. ImageMagickAis capable of converting many different image file formats to andDfrom MIFF (e.g. JPEG, XPM, TIFF, etc.). 

7   
Õ

>Description


>

A MIFF image file consist of two sections. The firstEsection is a header composed of keywords describing the image in text>form. The next section is the binary image data. The header isCseparated from the image data by a : character immediately followed by a ctrl-Z.

E

The MIFF header is composed entirely of LATIN-1 characters.AThe fields in the header are keyword and value combination in the?keyword=value format, with each keyword and value@separated by an equal sign (=). Each keyword=value>combination is delimited by at least one control or whitespaceCcharacter. Comments may appear in the header section and are alwaysDdelimited by braces. The MIFF header always ends with a colonD(:) character, followed by a ctrl-Z character. It isLalso common to precede the colon with a formfeed and a newlineBcharacter. The formfeed prevents the listing of binary dataDwhen using more(1) under Unix where the ctrl-Z has theDsame effect with the type command on the Win32 command line. 

9

The following is a list of keyword=value6combinations that may be found in a MIFF file: 


*
background-color=color
" border-color=color
! matte-color=color
C these optional keywords reflects the image background, border, andE matte colors respectively. A color can be a name (e.g. white)$ or a hex value (e.g. #ccc).
! class=DirectClass
! class=PseudoClass
A the type of binary image data stored in the MIFF file. If> this keyword is not present, DirectClass image data is assumed.
 colors=value
: the number of colors in a DirectClass image. For aA PseudoClass image, this keyword specifies the size of the@ colormap. If this keyword is not present in the header, and theC image is PseudoClass, a linear 256 color grayscale colormap@ is used with the image data.
The maximum number of colormap entries is 65535.
 columns=value
E the width of the image in pixels. This is a required keyword and has no default.
 colorspace=RGB
 colorspace=CMYK
> the colorspace of the pixel data. The default is RGB.
( compression=BZip
 compression=RLE
 compression=Zip
? the type of algorithm used to compress the image data. If this8 keyword is not present, the image data is assumed to be uncompressed.
2 delay <1/100ths of a second>
@ the interframe delay in an image sequence. The maximum delay is 65535.
 depth=8
 depth=16
depth=32
@ depth of a single color value representing values from 0 to 255? (depth 8), 65535 (depth 16), or 4294967295 (depth 32). If this- keyword is absent, a depth of 8 is assumed.
 dispose value
 GIF disposal method. '
 Here are the valid methods:
7    $ $   8    8    8    8  


Disposal



Description



0

"

No disposal specified.



1

*

Do not dispose between frames.



2

>

Overwrite frame with background color from header.



3

*

Overwrite with previous frame.


gamma=value
C gamma of the image. If it is not specified, a gamma of 1.0 (linear" brightness response) is assumed,
 id=ImageMagick
C identify the file as a MIFF-format image file. This keywordA is required and has no default. Although this keyword can appearD anywhere in the header, it should start as the first keyword of theD header in column 1. This will allow programs like file(1) to* easily identify the file as MIFF.
iterations value
> the number of times an image sequence loops before stopping.
 label={value}
? this optional keyword defines a short title or caption for theC image. If any whitespace appears in the label, it must be enclosed within double quotes.
 matte=True
 matte=False
C specifies whether a DirectClass image has matte data. MatteD data is generally useful for image compositing. This keyword has no! meaning for pseudocolor images.
` montage=<width>x<height>{+-}<xoffset>{+-}<yoffset>
D size and location of the individual tiles of a composite image. See; X(1) for details about the geometry specification.
> Use this keyword when the image is a composite of a number ofE different tiles. A tile consists of an image and optionally a border@ and a label. <width> is the size in pixels of eachF individual tile in the horizontal direction and <height>D is the size in the vertical direction. Each tile must have an equalB number of pixels in width and equal in height. However, the widthD can differ from the height. <xoffset> is the offset inE number of pixels from the vertical edge of the composite image whereA the first tile of a row begins and <yoffset> is theA offset from the horizontal edge where the first tile of a column begins.
D If this keyword is specified, a directory of tile names must followC the image header. The format of the directory is explained below.
f page=<width>x<height>{+-}<xoffset>{+-}<yoffset>
1 preferred size and location of an image canvas.
! profile-icc=value
@ the number of bytes in the International Color Consortium color7 profile. The profile is defined by the ICC profile specification.
" profile-iptc=value
B the number of bytes in the IPTCm Newsphoto profile. The profile is defined by the IPTCQ specification.
L profile-name=value
I the number of bytes in the generic profile name where nameD identifies the profile. Name is substituted with any LATIN-1= string to form a unique generic profile identifier.
 red-primary=x,y
! green-primary=x,y
blue-primary=x,y
 white-point=x,y
E these optional keywords reflect the chromaticity primaries and white point.
+ rendering-intent=saturation
+ rendering-intent=perceptual
) rendering-intent=absolute
) rendering-intent=relative
D Rendering intent is the CSS-1 property that has been defined by theE International Color Consortium.
D resolution=<x-resolution>x<y-resolution>
B vertical and horizontal resolution of the image. See units; for the specific resolution units (e.g. pixels per inch).
 rows=value
B the height of the image in pixels. This is a required keyword and has no default.
 scene=value
C the sequence number for this MIFF image file. This optionalC keyword is used when a MIFF image file is one in a sequence of files used in an animation.
 signature=value
E this optional keyword contains a string that uniquely identifies theA image pixel contents. NIST's SHA-256 message digest algorithm is recommended.
% units=pixels-per-inch
+ units=pixels-per-centimeter '
 image resolution units.


COther key value pairs are permitted. If a value contains whitespace5it must be enclosed with braces as illustrated here: 


 id=ImageMagick class=PseudoClass colors=256 compression=RLE columns=1280 rows=1024 scene=1+ signature=d79e1c308aa5bbcdeea8ed63df412da92 copyright={Copyright (c) 2000 ImageMagick Studio} <FF> :

CNote that keyword=value combinations may be separatedCby newlines or spaces and may occur in any order within the header.?Comments (within braces) may appear anywhere before the colon. 

A

The elements shown in the following table may appear after theDheader and before the image data. These elements appear in the orderCdescribed in the following table if the keyword indicates that they exist.

7     # # #                       


Element




Keyword




Description


'

Image directory


&

montage


C

The directory consists of a name for each tile ofD the composite image separated by a newline character. The1 list is terminated with a NULL character.


#

ICC Profile


*

profile-icc


+

Binary color profile.


$

IPTC Profile


+

profile-iptc


4

Binary IPTC Newsphoto profile.


(

Generic Profiles


:

profile-<name>


@

Binary generic profile. Multiple named generic profiles may exist.


A

Next comes the binary image data itself. How the image data isBformatted depends upon the class of the image as specified (or notBspecified) by the value of the class keyword in the header.BAll numeric values in the binary section are written with the most;significant bytes occuring first (big-endian ordering).

=

DirectClass images (class=DirectClass) areDcontinuous-tone, images stored as RGB (red, green, blue), RGBA (red,Cgreen, blue, alpha), CMYK (cyan, yellow, magenta, black), and CMYKAD(cyan, yellow, magenta, black, alpha) intensity values as defined byAthe colorspace and matte keywords. The size of eachDintensity value depends on the depth of the image. The depth, numberDof bytes, and numeric range of each value are shown in the following table:


7     $ $ $   8 8    9 8    9 8  


Depth



Bytes Per Value



Value Range



8



1



0..255



16



2



0..65535



32



4



0..4294967295

@

The alpha value (if it occurs) represents the degree of pixel*opacity (zero is totally transparent).

=

PseudoClass images (class=PseudoClass) areDcolormapped RGB images. The colormap is stored as a series ofBred, green, and blue pixel values. The size of each colormap value@depends on the image depth, as shown in the following table:


7      $ $ $ $   8 8  8   9 8  8   9 8  9 


Depth



Bytes Per Value



Value Range

$

Bytes Per Colormap Entry



8



1



0..255



3



16



2



0..65535



6



32



4



0..4294967295



12

A

The number of colormap entries is defined by the colorsBkeyword. The colormap data occurs immediately following the headerD(or image directory if the montage keyword is in the header).AImmediately following the colormap data is the PseudoClassEimage data. PseudoClass image data is an array of index valuesBinto the color map. The number of bytes comprising the index valueBdepends on the number of colors in the image. The followingDtable shows the number of bytes in each colormap index as determinedby the colors keyword:


7     $ $ $    8     8     8  


Colors



Bytes Per Index



Index Range

!

<=256



1



0..255

#

<=65535



2



0..65535

(

<=4294967295



4



0..4294967295

>

If matte is true, each colormap index is immediatelyDfollowed by an equally-sized alpha value. The alpha value represents>the degree of pixel opacity (zero is totally transparent).

<

The image data in a MIFF file may be uncompressed,Grunlength encoded, ZipAcompressed, or BZipDcompressed. The compression keyword in the header defines how@the image data is compressed. Uncompressed pixels are stored oneEscanline at a time in row order. Runlength encoded compression countsEruns of identical adjacent pixels and stores the pixels followed by aBlength byte (the number of identical pixels minus 1). Zip and BZip<compression compresses each row of an image and precedes theEcompressed row with the length of compressed pixel bytes as a word in#most significant byte first order. 

B

MIFF filesCmay contain more than one image. Simply concatenate each individual;image (composed of a header and image data) into one file. 

7   
Ñ

>Authors


1

John Cristy,]magick@wizards.dupont.comImageMagickStudio.

5




7   
Ó

>Copyright


)

Copyright (C) 2002 ImageMagick Studio 

>

Permission is hereby granted, free of charge, to any personDobtaining a copy of this software and associated documentation files9("ImageMagick"), to deal in ImageMagick withoutBrestriction, including without limitation the rights to use, copy,Emodify, merge, publish, distribute, sublicense, and/or sell copies of=ImageMagick, and to permit persons to whom the ImageMagick is9furnished to do so, subject to the following conditions: 

A

The above copyright notice and this permission notice shall be?included in all copies or substantial portions of ImageMagick. 

B

The software is provided "as is", without warranty of>any kind, express or implied, including but not limited to theCwarranties of merchantability, fitness for a particular purpose andBnoninfringement.In no event shall ImageMagick Studio be liable for>any claim, damages or other liability, whether in an action ofBcontract, tort or otherwise, arising from, out of or in connection>with ImageMagick or the use or other dealings in ImageMagick. 

E

Except as contained in this notice, theCname of the ImageMagick Studio LLC shall not be used in advertising:or otherwise to promote the sale, use or other dealings inDImageMagick without prior written authorization from the ImageMagickStudio. 



Home Page=Image manipulation software that works like magic.