1 unstable release

0.4.0 Nov 16, 2023

#487 in Images

Download history 27/week @ 2023-11-11 17/week @ 2023-11-18 15/week @ 2023-11-25 19/week @ 2023-12-02 18/week @ 2023-12-09 11/week @ 2023-12-16 9/week @ 2023-12-23 5/week @ 2023-12-30 9/week @ 2024-01-06 22/week @ 2024-01-13 9/week @ 2024-01-20 21/week @ 2024-01-27 11/week @ 2024-02-03 20/week @ 2024-02-10

63 downloads per month
Used in zune-image

MIT OR Apache-2.0 OR Zlib

135KB
2K SLoC

zune-bmp

A lean, mean and green BMP decoder.

This crate contains a fast implemtnation of a BMP decoder with battery included support for the esoteric parts of the spec

Features

  • RLE support
  • 1-bit,4-bit,8-bit,16-bit,24-bit and 32-bit support
  • Performant

Usage

First add the project to your library/binary

zune-bmp = "0.4" # Or use cargo add zune-bmp

Then you can toy with the other configs

use zune_bmp::BmpDecoder;
use zune_bmp::BmpDecoderErrors;

fn main()->Result<(),BmpDecodeErrors>{
    let decoder:Vec<u8> = BmpDecoder::new(b"BMP").decode()?;

}

Security

The decoder is continuously fuzz tested in CI to ensure it does not crash on malicious input in case a sample causes it to crash, an issue would be welcome.


lib.rs:

A versatile BMP decoder

This crate features a BMP decoder capable of decoding multiple BMP images fast

Features

  • no_std by default with alloc feature
  • Fast
  • Minimal dependencies
  • Very minimal internal allocation. (most paths do not allocate any more than output buffer)

Supported formats

  • RLE (4 bit and 8 bit)
  • Paletted images(1 bit, 2 bits, 4 bits and 8 bits)
  • Masked images (16 bit and 32 bit formats)

Unsupported formats

  • Embedded PNG and JPEGs

Usage

use zune_bmp::BmpDecoder;

let decoder:Vec<u8> = BmpDecoder::new(b"BMP").decode().unwrap();

Security

The decoder is continuously fuzz tested in CI to ensure it does not crash on malicious input in case a sample causes it to crash, an issue would be welcome.

Dependencies