#bmp #image #struct #creation #modification #automatic #bmp-img

yanked neobmp

A new library to simplify the creation and modification of .BMP files

0.2.0 Dec 25, 2022
0.1.7 Dec 24, 2022
0.1.6 Dec 24, 2022
0.1.5 Dec 24, 2022

#24 in #bmp

MIT license

8KB
157 lines

NEOBMP

NeoBmp is a library to simplify operations with the .bmp file format.

This crate includes the following:

- Structures to build your own BMP image.
- A generic `BmpImg` struct to create them all automatically and group them.
- Helpers to serialize all the structs AND the whole image .to_bytes()
- Helpers to write to a file and read from a file

Example usage:

use neobmp::BmpImg;

fn main() {
    let mut bmp_img = BmpImg::new(16, 16);

    bmp_img.fill_image(255, 0, 125);

    bmp_img.write_to_file("something.bmp");

    let mut another_bmp = BmpImg::from_file("something.bmp");
}

Add this to your Cargo.toml

[dependencies]
neobmp = "0.2.0"

No runtime deps