#bmp #bitmap #width-height #image #generate

bin+lib bumpy

A library for reading and manipulating bitmap (.bmp) files

5 releases

0.1.0 Jan 3, 2024
0.0.5 Mar 4, 2024
0.0.4 Jan 8, 2024

#10 in #width-height

Download history 5/week @ 2023-12-30 3/week @ 2024-01-06 3/week @ 2024-02-17 4/week @ 2024-02-24 136/week @ 2024-03-02 15/week @ 2024-03-09 1/week @ 2024-03-16

152 downloads per month

MIT license

3MB
509 lines

Work-in-progress Rust library for reading and manipulating bitmap (.bmp) files. Documentation here.

Usage

Add this to your Cargo.toml:

[dependencies]
bumpy = "0.0.5"

Features

Currently supports reading 24-bit and 8-bit .bmp files into a mutable struct, performing manipulations on the image such as greyscaling, rotation, or mirroring the image, and then writing the struct to a bitmap file. Also support generating a 24 bit bitmap file of given width and height.

Example

extern crate bumpy;

use bumpy::bmp::Bmp;

//open a file
let mut file = File::open("sample.bmp")?;

//build a Bmp struct from the file
let bmp = Bmp::build_from_file(&mut file)?;

//do stuff like greyscale it
bmp.greyscale();

//write the modified bmp to a new file
bmp2.write_to_file("test")?;

No runtime deps