AAI image file format ===================== The "AAI" is the internal format used in Dune devices to represent images with transparency (alpha channel) support. File format: int32 width; int32 height; int32[width * height] RGBA_pixel_data; // 0..254, 255 is prohibited NOTE: the "alpha" component of RGBA pixel data must be in range 0..254; 0 corresponds to fully transparent pixels; 254 corresponds to fully opaque pixels. 255 is a reserved value and must never be used. NOTE: All integers in a file are in Little-Endian (PC) byte order. NOTE: The maximum image size is 2047 x 2047 pixels, the minumum is 1 x 1 pixel. NOTE: When converting e.g. a BMP file to an AAI file, the recommended way to convert 0..255 range "alpha" values to 0..254 range supported by Dune is the following: 0..254 -> 0..254, 255 -> 254. E.g.: if (source_pixel.A == 255) target_pixel.A = 254; else target_pixel.A = source_pixel.A; AAImageGen converter application ================================ The "AAImageGen" converter application is used to convert image files of various formats to the "aai" format. It may work in the automatic mode -- it is enough to drag-and-drop the image file of any supported format (BMP, PNG, JPG, PSD and many others) onto the icon or a shortcut to the converter executable file ("AAImageGen.exe"). Then, next to the source image file, a new file will appear having the same name but the "aai" extension. If the transparency is not needed, a single-layer image file is enough, e.g. PNG, BMP, JPG or PSD. However, there is a possibility to use transparency, moreover, a complete alpha channel support is provided, that is, for each pixel its transparency level may be specified, and not only the fact of transparency. If, for example, Adobe Photoshop is used, an image in RGB mode should be created, the "Alpha" channel should be added in the "Channels" tab, and the required transparency should be expressed in that channel. Then it should be checked that the image has only one layer, and this layer is the "background"; otherwise, the correct behaviour of the converter is not guaranteed. To test the conversion result, the "aai" file may be dropped onto the converter icon, and it will be converted to "bmp". The converter application may work in manual mode -- if it is simply launched, it shows a dialog window offering to open the source image file in one of the supported formats. Before saving the conversion result, the resulting image is shown on the blue background (honoring the alpha channel if it exists). The converter application may work in command line mode -- if it is launched with a single argument pointing to a source file, it creates the conversion result in the same directory; if it is launched with two arguments pointing to a source and a target file, it stores the conversion result into the specified target file. ATTENTION: Because of an error in Adobe Photoshop versions up to and including the CS2 (newer versions were not checked), BMP files with alpha channel (32 bits per pixel) are saved incorrectly for some image sizes (e.g. 64x64). Therefore it is recommended to use the native PSD format when working with Photoshop.