ANI (file format)

{{Short description|File format for animated mouse cursors}}

{{about|the file format||Ani (disambiguation)}}

{{More sources needed|date=April 2024}}

{{Infobox file format

| name = ANI

| extension = {{mono|.ani}}

| mime =

| magic ={{code|ACON}} (4 bytes, ASCII)

| owner = Microsoft

| genre = animated raster image format for mouse cursors{{cite web|url=https://www.nationalarchives.gov.uk/pronom/fmt/386|access-date=April 1, 2025|title=Details for: Microsoft Animated Cursor Format|website=The National Archives}}

| containerfor =

| containedby =

| extendedfrom =

| extendedto =

}}

The ANI file format is a graphics file format used for animated mouse cursors on the Microsoft Windows operating system.{{Cite web |title=ANI File - What is an .ani file and how do I open it? |url=https://fileinfo.com/extension/ani |access-date=2024-04-27 |website=fileinfo.com}}

The format is based on the Microsoft Resource Interchange File Format, which is used as a container for storing the individual frames (which are standard Windows icons) of the animation.

File structure

The RIFF file structure description:

  1. define AF_ICON 0x1 // Windows format icon/cursor animation.
  2. define AF_SEQUENCE 0x2 // Animation is sequenced.

typedef struct {

DWORD cbSizeof; // Should be sizeof(ANIHEADER) = 36 bytes.

DWORD cFrames; // Count of frames in animation.

DWORD cSteps; // Number of steps in the cursor.

DWORD cx, cy; // Not used when AF_ICON is set.

DWORD cBitCount, cPlanes; // Not used when AF_ICON is set.

DWORD jifRate; // Default display rate, in jiffies (1/60s).

DWORD fl; // AF_ICON should be set. AF_SEQUENCE is optional.

} ANIHEADER;

RIFF('ACON'

[LIST('INFO'

[INAM()] // Cursor title. Optional.

[IART()] // Author name. Optional.

)]

'anih'() // ANI file header.

['rate'()] // Rate table (array of jiffies).

// If the AF_SEQUENCE flag is set

// then the count is ANIHEADER.cSteps,

// otherwise ANIHEADER.cFrames.

['seq '()] // Sequence table (array of frame index values).

// Should be present when AF_SEQUENCE flag is set.

// Count is ANIHEADER.cSteps.

LIST('fram' // List of frames data. Count is ANIHEADER.cFrames.

'icon'() // Frame 1

'icon'() // Frame 2

...

)

)

Individual frames are in ICO format.

Frame rates are measured in jiffies, with one jiffy equal to 1/60 of a second, or 16.666 ms.

Sequence information present in the file determines the sequence of frames, and allows frames to be played more than once, or in a different order than that in which they appear in the file. For example, if the animation contains three different images numbered 1, 2 and 3, and the sequence is 1-2-3-2-1, (five frames) then only three icons need to be stored in the file, thereby saving storage space.

If an ANI file is used as Windows cursor, the sequence will loop. There is no way of influencing that behavior.{{Cite web |title=file-format-ani |url=https://www.daubnet.com/en/file-format-ani |access-date=2025-05-03 |website=www.daubnet.com}}

Animated Cursor Editor for Windows NT (ANIEDIT) source code from MSDN October 2001 Library is a good source of knowledge about ANI file format structure.{{Cite web |title=MSDN Library October 2001 - Internet Archive |url=https://archive.org/details/MSDN_Library_October_2001 |access-date=2025-05-03 |website=archive.org}}

See also

References

{{reflist}}