Skip to content

Instantly share code, notes, and snippets.

@jaames
Last active October 19, 2024 19:42
Show Gist options
  • Save jaames/dd204a05cace042d899f556d1488fc10 to your computer and use it in GitHub Desktop.
Save jaames/dd204a05cace042d899f556d1488fc10 to your computer and use it in GitHub Desktop.
Anishare (https://anishare.co/) animation file format spec (reverse engineered)

⚠️ This spec is not official, and was reverse engineered on 19th October 2024. It may become out of date in the future as Anishare develops.

Header

Files always begin with a 50-byte header.

Offset Type Details
0 char[8] Magic ident "ANISHARE"
8 uint8 Version number (currently 0)
9 uint16 Frame width (usually 720?)
11 uint16 Frame height (usually 720?)
13 uint8 Layer count (usually 3?)
14 uint16 Frame count (max 240)
16 uint8 Frame rate (frames per second, max 24)
17 uint8 Flags
18 uint8[32] Padding (null bytes)

Flags

Flag Description
1 << 0 Playback is looped
1 << 1 Remixing is enabled

Frame Data

After the header, frames are stored in playback order, one after another. Each frame comprises a header followed by layer data. The frame header is always 20 bytes long.

Frame Header

Offset Type Details
0 uint16 Frame ID
2 uint8[3] Paper color
5 uint8[3] Pen color 1
8 uint8[3] Pen color 2
11 uint8[3] Pen color 3
14 uint8[6] Padding (null bytes)

Color

Colors are in the sRGB color space.

Index Details
0 Red
1 Green
2 Blue

Layer Data

All layers are stored in a single bitmap. The bitmap width is frame width * layer count, the bitmap height is frame height. The bitmap is 2 bits per pixel, going from left to right, top to bottom.

In this bitmap, layers are stored side-to-side horizontally, with the first layer being the leftmost slice.

A pixel will be 0 if it is transparent (paper color), 1 for the first pen color, 2 for the second pen color, and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment