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: 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
03 00 00 00Width
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
02 00 00 00Height
2 rows. Width × height × 4 tells a reader exactly how many bytes of pixels follow.
- 3
00 00 FF FEOne 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 FFis pure red. A reader that takes the bytes as R, G, B sees blue instead. - 4
FEOpaque 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
FF FF FF FE · 00 00 00 FERows 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
00 80 FF 80Partial 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
32No 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
| Bytes | Contents |
|---|---|
| 0 to 3 | Width in pixels, unsigned 32-bit, little-endian |
| 4 to 7 | Height in pixels, same encoding |
| 8 onwards | Width × 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
| AAI | PNG | 32-bit BMP | TGA | |
|---|---|---|---|---|
| Compression | None | Lossless | Usually none | None or RLE |
| Transparency | Alpha 0 to 254 | Full alpha | Alpha, not always honoured | Full alpha |
| Signature | None | 8 bytes | BM | None (a footer in version 2) |
| Metadata | None | Text, Exif, colour profiles | Colour profiles | Some |
| Supported by | Dune players, ImageMagick, GraphicsMagick | Everything | Almost everything | Image 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
.aaiextension. 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.
# 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.pngBecause the format is so simple, a reader takes a few lines of Python with Pillow:
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, putaai: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
- Dune HD: AAImageGen README (AAI format description)
- ImageMagick: AAI reader and writer source code (coders/aai.c)
- ImageMagick forum: adding support for the AAI format
- GraphicsMagick: supported formats
- SUSE: CVE-2017-8343 (ImageMagick ReadAAIImage memory leak)
Last reviewed 27 October 2026.