12 releases

0.2.3 Apr 16, 2024
0.2.2 Mar 30, 2024
0.1.7 Jan 6, 2024
0.1.4 May 29, 2023
0.1.0 Feb 26, 2023

#721 in Game dev

Download history 3/week @ 2024-02-16 13/week @ 2024-02-23 12/week @ 2024-03-01 20/week @ 2024-03-08 150/week @ 2024-03-15 131/week @ 2024-03-22 219/week @ 2024-03-29 27/week @ 2024-04-05 144/week @ 2024-04-12 17/week @ 2024-04-19 5/week @ 2024-04-26

168 downloads per month
Used in 2 crates (via buffer-graphics-lib)

Custom license

110KB
3K SLoC

Crates.io Documentation

ICI Files

Usage

ici-files = "0.2.3"

Encodes and decodes ICI files and JASC palettes

Designed to be used with Buffer Graphics, and in turn Pixel Graphics.

Indexed Color Images come in two forms:

  1. Single
  2. Animated

All three may contain palette data in one of these forms:

  1. No palette data
  2. Palette ID (u16)
  3. Palette Name (String 1..=255)
  4. Palette Colours (RGBA 1..=255)

Palettes

No Data

The file doesn't contain any palette information. The Image struct will default to a palette of the correct size but filled with transparency. Use Image::with_palette to set the palette or Image::set_color to set a specific color.

ID

The file has a palette ID between 0..=65535. The Image struct will default to a palette of the correct size but filled with transparency. Use Image::with_palette to set the palette or Image::set_color to set a specific color.

Name

The file has a UTF-8 palette name, between 1..=255 bytes long. The Image struct will default to a palette of the correct size but filled with transparency. Use Image::with_palette to set the palette or Image::set_color to set a specific color.

Colors

The file contains a list of RGBA colors.

Image formats

Single

Single static image, max width and height is 255

Animated

Multi frame image, max width, height and frame count is 255. Also contains a frame rate as fractional seconds per frame. All frames must be the same size.

IndexedWrapper

Stores either a static or animated image and provides a limited abstract interface

Features

Default: serde

Serde

Adds serialize and deserialize to some structs

Dependencies

~0.4–1MB
~24K SLoC