use rbg for pixel data in bitmatrix convert

This commit is contained in:
Henry Schimke
2023-01-10 09:13:41 -06:00
parent c50e909450
commit 4bd2e53a5c

View File

@@ -677,10 +677,13 @@ impl From<&BitMatrix> for image::DynamicImage {
for y in 0..value.height {
for x in 0..value.width {
let pixel_value = if value.get(x, y) { u8::MIN } else { u8::MAX };
let pixel_intrior = [pixel_value, pixel_value, pixel_value];
let pixel = image::Rgb(pixel_intrior);
pixels.put_pixel(
x,
y,
image::Luma([if value.get(x, y) { u8::MIN } else { u8::MAX }]),
pixel,
);
}
}