Crate pie_format

source ·
Expand description

A reference implementation for the PIE image format. This lossless image format only optionally stores colors in the file. It is designed to be used in conjunction with a palette from which colours can be sampled by the decoder. Using an external palette reduces uncompressed image size by 75% assuming a four channel format like RGBA, or 60% assuming a 3 channel format like RGB without alpha. Using an internal palette will increase the size depending on the palette, but still generally be smaller than other formats like PNG for pixel art or images with limited palettes.

Structs

  • Decoded PIE file into pixel data for use in your graphics pipeline.
  • A struct encoded with the necessary data for writing. You cannot just dump this struct into a file. To write - use the self::write function.
  • Palette for embedding or keeping external. The maximum amount of colours supported is 256.

Enums

Functions

  • Decode raw bytes from PIE format into a DecodedPIE.
  • Encode an array of RGB or RGBA bytes into an EncodedPIE. Note that an EncodedPIE struct is not the same format as a saved .PIE file. To get the correct format for saving, use the write function.
  • Read a PIE file from disk and decode it into a DecodedPIE. Palette is required if not included in the image.
  • Encode a series of u8s into runs (count, value) with a max of limit.
  • Encode and write a PIE file to disk.