image-to-oled

Crates.ioimage-to-oled
lib.rsimage-to-oled
version0.5.0
sourcesrc
created_at2022-11-25 08:38:14.233088
updated_at2023-02-24 14:35:45.843807
descriptionConverts an ImageBuffer to a 128x64 SSD1306 OLED byte vector
homepage
repositoryhttps://github.com/mdegraw/image-to-oled
max_upload_size
id722618
size19,573
Michael DeGraw (mdegraw)

documentation

README

Image to OLED build badge docs.rs version

Converts an ImageBuffer to a 128x64 SSD1306 OLED byte vector

Example

let image_buffer: ImageBuffer<Rgb<u8>, Vec<u8>> =
    ImageBuffer::from_vec(640, 480, vec![155; (1024 * 1024 * 3) as usize]).unwrap();
// get bytes vec, specifying the brightness threshold 
// as a number between 0 and 255
let bytes = to_oled_bytes(&image_buffer, 100);
Commit count: 41

cargo fmt