File types · Explainer

The AAI file (.aai)

An AAI file is an AAI Dune image: the minimal, uncompressed image format that Dune HD media players use for icons and other graphics with transparency, also readable and writable by ImageMagick. This guide explains its 8-byte header and pixel layout, its odd rule about alpha values, why hardly anything else uses it, and how to convert it.

At a glance

Full name
AAI Dune image (ImageMagick's name); GraphicsMagick also lists it as Auburn Animation Image
Extensions
.aai
MIME type
None registered; servers usually send application/octet-stream
Kind
Binary raster image, uncompressed: 8-bit blue, green, red and alpha per pixel
Owner
Dune HD, the maker of Dune media players; no published standard beyond the notes with its converter
Header
8 bytes: width and height as 32-bit little-endian integers
Magic number
None: files are recognised by their extension
Maximum size
2047 × 2047 pixels, according to Dune's documentation
Transparency
Alpha from 0 (transparent) to 254 (opaque); 255 is reserved
Opens with
Dune HD players; ImageMagick and GraphicsMagick (read and write); Dune's AAImageGen converter; not browsers, Pillow or the built-in photo viewers

The basics

What is an AAI file?

AAI is the internal image format of Dune HD media players, which a post on ImageMagick's forum describes as HDI's Dune media streamers. Dune's documentation calls it the format its devices use to represent images with transparency, and GraphicsMagick's format list gives icons for internet radio stations and channels as an example.

The format is as simple as an image file can be: the width, the height, and then 4 bytes per pixel, with nothing to decode. Dune published a free converter, AAImageGen, that turns BMP, PNG, JPG and PSD files into AAI.

AAI reached a wider audience through ImageMagick. A Dune user asked on the ImageMagick forum for support, describing AAI as a very simple format used by Dune media streamers; ImageMagick's developer noted it was very similar to ImageMagick's AVS format and added it. ImageMagick lists it as "AAI Dune image", and its format list is where most people first see the name.

What the letters stand for

Neither Dune nor ImageMagick explains the name. GraphicsMagick's format list gives "Auburn Animation Image" as another name, but we found no source for it, and AAI files hold a single still image.

Anatomy

What's inside an AAI file

An AAI file is two numbers and then the pixels, nothing else. Below is every byte of a 32-byte file we made for this page by converting a 3 × 2 pixel PNG with ImageMagick: five opaque pixels and one half-transparent orange one. It isn't offered for download.

tiny.aai (hex, 32 bytes)
tiny.aai: 3 × 2 pixels, 32 bytes, written by ImageMagick

offset  bytes          part
0       03 00 00 00    width: 3 (32-bit, little-endian)
4       02 00 00 00    height: 2

        pixels, 4 bytes each: blue, green, red, alpha
8       00 00 FF FE    row 1: red, opaque
12      00 FF 00 FE           green, opaque
16      FF 00 00 FE           blue, opaque
20      FF FF FF FE    row 2: white, opaque
24      00 00 00 FE           black, opaque
28      00 80 FF 80           orange, alpha 128: half transparent
32                     end of file: 8 + 3 × 2 × 4 bytes
  1. 103 00 00 00

    Width

    A 32-bit unsigned integer, least significant byte first: 3. There's no signature before it, so nothing in the file says it's an AAI image.

  2. 202 00 00 00

    Height

    2 rows. Width × height × 4 tells a reader exactly how many bytes of pixels follow.

  3. 300 00 FF FE

    One pixel

    Dune's notes describe each pixel as one 32-bit RGBA value stored little-endian. Written out byte by byte, that's blue, green, red, alpha: 00 00 FF is pure red. A reader that takes the bytes as R, G, B sees blue instead.

  4. 4FE

    Opaque is 254

    Alpha runs from 0 (fully transparent) to 254 (fully opaque). 255 is reserved and must never be used, so ImageMagick writes 254 for every opaque pixel, even when the source image had no transparency at all.

  5. 5FF FF FF FE · 00 00 00 FE

    Rows from the top

    Pixels run left to right, rows from the top down. There's no padding at the end of a row, whatever the width.

  6. 600 80 FF 80

    Partial transparency

    Blue 0, green 128, red 255 (orange) with alpha 128: about half transparent. Colours are stored in full, not premultiplied by the alpha, as far as ImageMagick's reader and writer treat them.

  7. 732

    No trailer

    The file ends after the last pixel: 8 + 6 × 4 = 32 bytes. No compression, no metadata, no colour profile, no checksum.

Under the hood

How an AAI file is laid out

BytesContents
0 to 3Width in pixels, unsigned 32-bit, little-endian
4 to 7Height in pixels, same encoding
8 onwardsWidth × height pixels, 4 bytes each: blue, green, red, alpha; rows from the top, no padding

Dune's own description is shorter still: two 32-bit integers for the width and height, then one 32-bit RGBA value per pixel, all little-endian, with images from 1 × 1 to 2047 × 2047 pixels. Storing the value 0xAARRGGBB least significant byte first gives the byte order B, G, R, A, the same order as in a 32-bit Windows BMP or TGA file.

That makes the size of a file entirely predictable: 8 + 4 × width × height bytes. A full-screen 1920 × 1080 image is 8,294,408 bytes, about 8.3 MB, whatever is in it; a PNG of a simple graphic that size is usually far smaller.

Quirks

Why opaque is 254, not 255

In almost every image format, an 8-bit alpha of 255 means fully opaque. In AAI, the value 255 is reserved and must never be used: Dune's documentation says alpha runs from 0 (fully transparent) to 254 (fully opaque), and recommends converting from the usual 0 to 255 range by leaving 0 to 254 alone and changing 255 to 254. It doesn't say what the reserved value is for.

  • ImageMagick follows the rule both ways. Its writer turns every alpha of 255 into 254, and its reader turns 254 back into 255. A round trip through AAI and back to PNG gives the same image, except that a pixel whose alpha really was 254 comes back as 255.
  • Other readers may not. Code that reads the bytes directly sees 254 as very slightly transparent: invisible on screen, but enough to make an image count as "has transparency" in software that checks.
  • Writing your own files: clamp alpha to 254. A file with 255 in it may display wrongly on a Dune player.

Comparison

AAI vs PNG, BMP and TGA

AAIPNG32-bit BMPTGA
CompressionNoneLosslessUsually noneNone or RLE
TransparencyAlpha 0 to 254Full alphaAlpha, not always honouredFull alpha
SignatureNone8 bytesBMNone (a footer in version 2)
MetadataNoneText, Exif, colour profilesColour profilesSome
Supported byDune players, ImageMagick, GraphicsMagickEverythingAlmost everythingImage editors, game tools

Outside a Dune player, there's no reason to choose AAI. PNG stores the same pixels and transparency losslessly in a fraction of the space, carries metadata and opens everywhere. If you need raw, uncompressed pixels for a program of your own, a PAM file has a documented header and a magic number, or you can write the bytes with no header at all.

In practice

Why almost nobody uses AAI

  • One kind of device. It was made for Dune players' own graphics, not as a general format, and no operating system, browser or mainstream image editor adopted it.
  • No compression. Every pixel takes 4 bytes, so files are many times larger than a PNG of the same picture.
  • No signature. Nothing inside a file identifies it, so software can only trust the .aai extension. Most file-type detectors can't recognise an AAI file that has been renamed.
  • No documentation beyond a README. The only description from Dune is a short text file that comes with its converter.

Most people who meet an AAI file today either own a Dune player or saw AAI in ImageMagick's list of formats and wondered what it was.

How to

How to open and convert an AAI file

  • ImageMagick (Windows, macOS, Linux) reads and writes AAI. This is the easiest way to view or convert one.
  • GraphicsMagick lists read and write support too.
  • AAImageGen, Dune's own converter, turns BMP, PNG, JPG and PSD into AAI, and an AAI back into BMP to check the result. Dune recommends an RGB source with an alpha channel and a single layer.
  • Pillow, browsers and the built-in viewers of Windows and macOS can't open AAI.
terminal
# AAI to PNG, keeping the transparency
convert icon.aai icon.png          # ImageMagick 6
magick icon.aai icon.png           # ImageMagick 7

# PNG to AAI for a Dune player
convert icon.png icon.aai

# a file without the .aai extension: name the format
convert aai:icon.bin icon.png

Because the format is so simple, a reader takes a few lines of Python with Pillow:

aai_to_png.py
import struct, sys
from PIL import Image

data = open(sys.argv[1], "rb").read()
width, height = struct.unpack_from("<II", data, 0)
img = Image.frombuffer("RGBA", (width, height), data[8:8 + 4 * width * height],
                       "raw", "BGRA", 0, 1)
img.save(sys.argv[2])

Troubleshooting

Common AAI problems, and safety

  • "No decode delegate for this image format". ImageMagick picks the AAI reader from the file name. If the extension isn't .aai, put aai: in front of the file name.
  • Red and blue are swapped. The pixels were read as R, G, B, A. AAI stores blue first.
  • The image is slanted or garbage. The header was misread (for example as big-endian), or the file is truncated or not an AAI file at all. Check that the file size is exactly 8 + 4 × width × height.
  • Transparency looks wrong on the player. The file contains alpha values of 255, which are reserved. Re-save it with ImageMagick or AAImageGen, both of which write 254 instead.

An AAI file can't contain anything executable. The risk is in readers: with no signature and no checksum, any file renamed to .aai is accepted, and its first 8 bytes become the dimensions. A reader should check them against the file size and a sensible limit before allocating memory. ImageMagick's AAI reader has had bugs of its own, such as a memory leak triggered by a crafted file (CVE-2017-8343, in version 7.0.5-5), so keep image libraries up to date if they handle uploads.

Sample files

There are no sample AAI files on this page yet. To make one for testing, convert any image with ImageMagick: convert input.png output.aai (or magick input.png output.aai with ImageMagick 7).

Put it online

Have an AAI file? Give it a link.

Drop an AAI image on 99helpers and it gets its own web address. Browsers can't display AAI, so anyone who opens the link downloads the file, ready to copy to a Dune player or convert; upload a PNG copy next to it if people need to see it.

Questions

AAI files, frequently asked

What is an .aai file?

An AAI Dune image: an uncompressed image with transparency used by Dune HD media players, for example for icons and menu graphics. It's an 8-byte header followed by 4 bytes per pixel.

How do I open an AAI file?

Convert it with ImageMagick: convert input.aai output.png (or magick in version 7). Browsers, Pillow and the photo viewers built into Windows and macOS can't open it.

How do I convert a PNG to AAI?

Run convert input.png output.aai with ImageMagick, or use Dune's AAImageGen converter. Both keep the transparency and write opaque pixels with alpha 254, as the format requires.

What does AAI stand for?

No official expansion is published. ImageMagick calls the format "AAI Dune image"; GraphicsMagick also lists the name "Auburn Animation Image", which we couldn't confirm elsewhere.

Does AAI support transparency?

Yes. Each pixel has an 8-bit alpha value from 0 (transparent) to 254 (opaque). The value 255 is reserved and must not be used.

Why is my AAI file so large?

AAI isn't compressed: every pixel takes 4 bytes, so a 1920 × 1080 image is about 8.3 MB. A PNG of the same picture is usually much smaller.

Why are red and blue swapped in my AAI reader?

The pixel bytes are stored as blue, green, red, alpha, not red first. Read them as BGRA.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.