About animated cursors
Please read the following topic because it contains useful information about how AniTuner creates animated cursors.

How are stored animated cursors?

The .ani file format is used for reading and storing Windows Animated Cursors (animated mouse pointer). A .ani file is a structured format (Microsoft RIFF) that contains information about the animation (author & title, steps, length & order of each step...) followed by several frames stored in the icon format.

Like movies and cartoons, several icon frames such as img are displayed one by one and this leads to the final animated cursor: animated dino.

Each frame/step in an animated cursor is displayed during a short time (delay or length): this is the frame timing.

imgThis time is measured in jiffies; 1 jiffy=1/60th of a second~16,66 ms.

What are icons and why do they look transparent?

An icon is a picture that consists of a bitmapped image combined with a mask or an alpha channel to create transparent areas in the picture.

Each icon image can contain transparent areas - as you can see on the Windows desktop for example.

To create transparency (bit-transparency) in icons, we use a bitmapped image combined with a mask.

img Detailed steps: in the following paragraph we will describe the steps how this icon image icon can appear transparent.

1) The bitmapped image (we call it "color bitmap" in AniTuner or "XOR bit mask") is first completely filled with a color called the background color (or the transparent color):

bg color (on this sample this is fuchsia).

2) Then we draw the final image (that we want to show) on the background:


Now we know that pixels (point of an image) with the transparent color (in fuchsia) should appear transparent while other ones should be non transparent.
This is enough to create the mask.

3) The mask bitmap is a monochrome bitmap (we call it "mask bitmap" in AniTuner or "AND bit mask"): it only contains black and white pixels. White where the area should be transparent, otherwise black.
Thus to create the mask bitmap we replace the background color (fuchsia) with white, and other remaining colors with black. This gives this result:


To create and display the final icon, Windows uses the color and mask bitmaps to generate the transparency.

Hint: in AniTuner, be sure to always select a background color that is not used in your image. Generally fuchsia or teal are good choices as background colors.

Note: 32-bit XP and Vista RGBA icons support partial transparency provided by an alpha channel (they can be alpha-blended). The mask bitmap is superseded by the alpha channel. AniTuner fully supports this icon format.

img Each icon image has its own size: widthxheight in pixels (a picture counts width*height pixels). Icons may have different sizes (generally up to 256x256 but higher icon images are possible). Generally you will meet square icons with the following sizes: 16x16, 32x32, 48x48, etc... These sizes are common in Windows: for instance, 32x32 icons are displayed on your desktop (of Windows 9x), 16x16 icons are used in the taskbar and quick launch bar, 24x24 icons in the Start menu...

At least icons must contain one image (generally 32x32). But most of the time you will meet icons containing two or three image sizes: 16x16, 32x32, 48x48 (especially in 2000/XP icons) and 256x256 (Vista icons).

noteImportant: currently Windows only supports displaying 32x32 cursors, although AniTuner lets you create cursors of different sizes. This may change in future Windows versions.

img Finally, each icon image has its own color depth or pixel format. This is actually the number of colors used to draw the icon image: it may vary from 2 colors to 16.8M colors. The pixel format is in bits and the number of colors is just equal to 2^bits. Thus if the pixel format is n bits, each pixel in the image will need n bits (and n/8 bytes) to be coded.

Cursor Pixel FormatNumber of colors
1-bit2 - white & black
4-bit16 = 2^4
8-bit256 = 2^8
24-bit16.8M = 2^24 - true colors RGB
32-bit16.8M + 8-bit alpha channel - true colors RGBA

Other pixel formats are possible but AniTuner will automatically convert them (when possible) to 24-bit or 8-bit.

These different color depths are of course related to the screen resolution. Windows will select the best icon image according to your current resolution of the system's screen. For example, 4-bit icons are used if the screen displays 16 or 256 colors only. With Windows XP or Vista, you will generally use 32-bit icons or 24-bit ones when the latter are not available.

How can I use animated cursors with Windows?

If your .ani files are correctly associated, you can preview them using Windows Explorer: choose an animated cursor file and go to the File Properties window. Windows will display the animated cursor.

Animated cursors were created in order to customize the mouse pointers in Windows: the mouse applet in the Windows control panel lets you change the system cursors used during different operations (wait, no selection, etc...). Select the "Pointers" tab in the mouse applet and then highlight the pointer you want to replace. Click "Browse" and finally select the animated cursor you want.

For programmers only

If you are interested in the animated cursor format itself, then visit the useful site www.wotsit.org by Paul Oliver, and look for ANI.
Otherwise you can read the following extract of a post by R. James Houghtaling regarding the ANI format:

This is a paraphrase of the format. It is essetially just a RIFF file with extensions... (view this monospaced)
This info basically comes from the MMDK (Multimedia DevKit). I don't have it in front of me, so I'm going backwards from a VB program I wrote to decode .ANI files.

"RIFF" {Length of File}
"LIST" {Length of List}
"INAM" {Length of Title} {Data}
"IART" {Length of Author} {Data}
"icon" {Length of Icon} {Data} ; 1st in list
"icon" {Length of Icon} {Data} ; Last in list (1 to cFrames)
"anih" {Length of ANI header (36 bytes)} {Data} ; (see ANI Header TypeDef )
"rate" {Length of rate block} {Data} ; ea. rate is a long (length is 1 to cSteps)
"seq " {Length of sequence block} {Data} ; ea. seq is a long (length is 1 to cSteps)


- Any of the blocks ("ACON", "anih", "rate", or "seq ") can appear in any order. I've never seen "rate" or "seq " appear before "anih", though. You need the cSteps value from "anih" to read "rate" and "seq". The order I usually see the frames is: "RIFF", "ACON", "LIST", "INAM", "IART", "anih", "rate", "seq ", "LIST", "ICON". You can see the "LIST" tag is repeated and the "ICON" tag is repeated once for every embedded icon. The data pulled from the "ICON" tag is always in the standard 766-byte .ico file format (for the 16-color animated cursors only).

- All {Length of...} are 4byte DWORDs.

- ANI Header TypeDef:

struct tagANIHeader {
DWORD cbSizeOf; // Num bytes in AniHeader (36 bytes)
DWORD cFrames; // Number of unique Icons in this cursor
DWORD cSteps; // Number of Blits before the animation cycles
DWORD cx, cy; // reserved, must be zero.
DWORD cBitCount, cPlanes; // reserved, must be zero.
DWORD JifRate; // Default Jiffies (1/60th of a second) if rate chunk not present.
DWORD flags; // Animation Flag (see AF_ constants)
} ANIHeader;

#define AF_ICON =3D 0x0001L // Windows format icon/cursor animation

R. James Houghtaling >>

img Opening an animation file

img Create animate cursors with AniTuner

img Convert animated cursors to another format