MIFF(4)
π MIFF(4) β from the Kernel Interfaces Manual π
πΈ NAME πΈ
MIFF β the Magick Image File Format, bestie. That's the whole name, no notes. π
β¨ SYNOPSIS β¨
#include <image.h>
π¦ DESCRIPTION π¦
okay so. The Magick Image File Format (MIFF) is a platform-independent format for storing bitmap images. It's part of the ImageMagick toolkit of image manipulation utilities for the X Window System, and ImageMagick can convert sooo many different image file formats to and from MIFF (like JPEG, XPM, TIFF, etc.) β it's giving universal translator, fr fr. π
A MIFF image file is literally just two sections, bestie:
- A header made of keys that describe the image in text form.
- The binary image data.
The header and the image data are separated by a : character immediately followed by a newline. No cap. π
The MIFF header is composed entirely of LATIN-1 characters. The fields in the header are a key and value combo in the key=value format, with each key and value separated by an equal sign (=). Each key=value combo is delimited by at least one control or whitespace character. Comments can show up in the header section and are always delimited by braces. π«Ά
The MIFF header always ends with a colon (:) character, followed by a ctrl-Z character. It's also common to precede the colon with a formfeed and a newline character. The formfeed prevents the listing of binary data when using more(1) under Unix, where the ctrl-Z does the same thing with the type command on the Win32 command line. iconic behaviour honestly. π
π the key=value combos you might find in a MIFF file π
background-color=color,border-color=color,matte-color=colorβ these optional keys reflect the image background, border, and matte colors respectively. A color can be a name (e.g.white) or a hex value (e.g.#ccc). πclass=DirectClass,class=PseudoClassβ the type of binary image data stored in the MIFF file. If this key isn't present,DirectClassimage data is assumed. no key, no problem. β¨colors=valueβ the number of colors in aDirectClassimage. For aPseudoClassimage, this key specifies the size of the colormap. If this key isn't present in the header, and the image isPseudoClass, a linear 256 color grayscale colormap is used with the image data. The maximum number of colormap entries is 65535. Also,colorspace=CMYKβ the colorspace of the pixel data. The default isRGB. πcolumns=valueβ the width of the image in pixels. This is a required key and has no default. πcompression=BZip,compression=Fax,compression=JPEG,compression=LZW,compression=RLE,compression=Zipβ the type of algorithm used to compress the image data. If this key isn't present, the image data is assumed to be uncompressed. π¦delay <1/100ths of a second>β the interframe delay in an image sequence. The maximum delay is 65535. β³depth=8,depth=16β the depth of a single color value representing values from0to255(depth 8) or65535(depth 16). If this key is absent, a depth of8is assumed. πdispose valueβ GIF disposal method. Here are the valid methods: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β the gamma of the image. If it isn't specified, a gamma of1.0(linear brightness response) is assumed. β¨id=ImageMagickβ 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 lets programs likefile(1)easily identify the file as MIFF. main character key energy fr. πiterations valueβ the number of times an image sequence loops before stopping. πlabel={value}β defines a short title or caption for the image. If any whitespace appears in the label, it must be enclosed within braces. πmatte=True,matte=Falseβ specifies whether aDirectClassimage has matte data. Matte data is generally useful for image compositing. This key has no meaning for pseudo-color images. πmontage=<width>x<height>{+-}<x offset>{+-}<y offset>β size and location of the individual tiles of a composite image. SeeX(1)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. <width> is the size in pixels of each individual tile in the horizontal direction and <height> 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. <x offset> is the offset in number of pixels from the vertical edge of the composite image where the first tile of a row begins, and <y offset> 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. π
page=valueβ preferred size and location of an image canvas. π¦profile-icc=valueβ the number of bytes in the International Color Consortium color profile. The profile is defined by the ICC profile specification located atftp://sgigate.sgi.com/pub/icc/icc34.ps. πcolorspace=RGBβ (yes, it's chillin' on its own line, the header just be like that sometimes π)red-primary=x,y,green-primary=x,y,blue-primary=x,y,white-point=x,yβ this optional key reflects the chromaticity primaries and white point. π¨rendering-intent=saturation,rendering-intent=perceptual,rendering-intent=absolute,rendering-intent=relativeβ Rendering intent is the CSS-1 property that has been defined by the International Color Consortium (http://www.color.org). πresolution=<x-resolution>x<y-resolution>β vertical and horizontal resolution of the image. Seeunitsfor the specific resolution units (e.g. pixels per inch). πrows=valueβ the height of the image in pixels. This is a required key and has no default. πscene=valueβ 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. π¬signature=valueβ this optional key contains a string that uniquely identifies the image pixel contents. NIST's SHA-256 message digest algorithm is recommended. πunits=pixels-per-inch,units=pixels-per-centimeterβ 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>
:
Note that key=value 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. π«Ά
π§ what comes after the header π§
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 newline character. The list is terminated with a NULL character. π
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. π
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. π
π DirectClass, PseudoClass & the pixel tea π
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. πΈ
π compression vibes π
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 precedes 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. slay. π₯
π SEE ALSO π
display(1), animate(1), import(1), montage(1), mogrify(1), convert(1), more(1), compress(1)
π COPYRIGHT π
okay bestie, legal era incoming, but it's actually kinda wholesome so stay with me π«Ά
Copyright (C) 2000 ImageMagick Studio, a non-profit organization dedicated to making software imaging solutions freely available. yes, a non-profit, they're literally just out here giving away imaging software for the plot π
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("ImageMagick"), to deal in ImageMagick without restriction, including without limitation the rights to:
- use it π
- copy it π
- modify it π
- merge it π
- publish it π
- distribute it π
- sublicense it π
- and/or sell copies of ImageMagick π
...and to permit persons to whom ImageMagick is furnished to do so too, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of ImageMagick. that's the whole condition, no cap, don't strip the notice β¨
the "as is" part, aka the vibes disclaimer π
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. no promises, fr fr π
In no event shall ImageMagick Studio be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with ImageMagick or the use or other dealings in ImageMagick. so like, if it breaks, that's between you and the universe π
the name clause π
Except as contained in this notice, the name of the ImageMagick Studio shall not be used in advertising or otherwise to promote the sale, use or other dealings in ImageMagick without prior written authorization from the ImageMagick Studio. you can't just slap their name on ur product to farm clout, get that permission in writing first π
π AUTHORS π
John Cristy, ImageMagick Studio β the main character, the icon, the legend π
and that's the whole page bestie, you ate it πβ¨
this little masterpiece comes to you from ImageMagick, dated $Date$, and it's serving MIFF(4) realness. go forth and miff responsibly ππ¦
π¦ where this page comes from
- alpine 3.24: graphicsmagick-doc 1.3.47-r0 Β· MIT
- arch rolling: graphicsmagick 1.3.49-3 Β· MIT
- debian trixie: graphicsmagick 1.4+really1.3.45+hg17696-1
- epel 10: GraphicsMagick 1.3.45-1.el10_1 Β· MIT
- fedora 43: GraphicsMagick 1.3.45-5.fc43 Β· MIT
- fedora 43: GraphicsMagick 1.3.45-5.fc43 Β· MIT
- fedora 44: GraphicsMagick 1.3.45-7.fc44 Β· MIT
- fedora 44: GraphicsMagick 1.3.45-7.fc44 Β· MIT
- nixpkgs unstable: graphicsmagick 1.3.49
- opensuse-leap 16.0: GraphicsMagick 1.3.45-160000.13.1 Β· MIT
- opensuse-leap 16.0: GraphicsMagick 1.3.45-160000.13.1 Β· MIT
- opensuse-leap 16.0: GraphicsMagick 1.3.45-160000.13.1 Β· MIT
- opensuse-leap 16.0: GraphicsMagick 1.3.45-160000.13.1 Β· MIT
- ubuntu questing: graphicsmagick 1.4+really1.3.45+hg17696-1build1
- ubuntu resolute: graphicsmagick 1.4+really1.3.46-2
- ubuntu stonking: graphicsmagick 1.4+really1.3.48-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms