#oled #byte-vector #ssd1306 #convert #image #128x64 #image-buffer

image-to-oled

Converts an ImageBuffer to a 128x64 SSD1306 OLED byte vector

5 releases (breaking)

0.5.0 Feb 24, 2023
0.4.0 Feb 24, 2023
0.3.0 Nov 25, 2022
0.2.0 Nov 25, 2022
0.1.0 Nov 25, 2022

#4 in #ssd1306

Apache-2.0

8KB
62 lines

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);

Dependencies

~5MB
~60K SLoC