3 releases (breaking)

0.5.0-rc0 Apr 7, 2024
0.4.0 Nov 16, 2023
0.2.0 Apr 30, 2023

#37 in #image-encoding

Download history 16/week @ 2024-06-24 74/week @ 2024-07-01 18/week @ 2024-07-08 4/week @ 2024-07-15 54/week @ 2024-07-22 229/week @ 2024-07-29 149/week @ 2024-08-05 157/week @ 2024-08-12 5/week @ 2024-08-19 72/week @ 2024-08-26 27/week @ 2024-09-02 13/week @ 2024-09-09 18/week @ 2024-09-16 44/week @ 2024-09-23 70/week @ 2024-09-30 7/week @ 2024-10-07

140 downloads per month
Used in zune-image

MIT OR Apache-2.0 OR Zlib

115KB
1.5K SLoC

Zune-farbfeld

Farbfeld decoding and encoding support

Usage

Add zune-farbfeld to your Cargo.toml

zune-farbfeld = "[LATEST]"

You can then use FarbfeldDecoder to decode images and FarbfeldEncoder to encode images

Endianness

Where endianness matters, the library either takes or uses native endian


lib.rs:

farbfeld is a lossless image format which is easy to parse, pipe and compress. It has the following format:

╔════════╤═════════════════════════════════════════════════════════╗
║ Bytes  │ Description                                             ║
╠════════╪═════════════════════════════════════════════════════════╣
║ 8      │ "farbfeld" magic value                                  ║
╟────────┼─────────────────────────────────────────────────────────╢
║ 4      │ 32-Bit BE unsigned integer (width)                      ║
╟────────┼─────────────────────────────────────────────────────────╢
║ 4      │ 32-Bit BE unsigned integer (height)                     ║
╟────────┼─────────────────────────────────────────────────────────╢
║ [2222] │ 4x16-Bit BE unsigned integers [RGBA] / pixel, row-major ║
╚════════╧═════════════════════════════════════════════════════════╝
The RGB-data should be sRGB for best interoperability and not alpha-premultiplied.

Dependencies