Hi,
I'm trying to render a BMP image to a 7-color waveshare display.
The embedded-graphics has support for BMP images using the tinybmp crate, and it allows to specify a color space (eg Bmp::<OctColor>::from_slice(...)) but OctColor needs to implement From<Rgb555> and From<Rgb565>.
Right now this crate implements only From<embedded_graphics_core::pixelcolor::Rgb888>.
The implementation could be similar to the Rgb888 one, that tries to find the closest colors.
I'd make a PR but sadly I'm not familiar with graphics at all.
Just for testing I created an implementation for From<Rgb555> and From<Rgb565> that simply converts the value into Rbg888 and use its From implementation to convert the image.
I tested it with this image from the Waveshare repo example that was already converted to the correct color table, and just worked. Of course it needs a better implementation but it works.
Hi,
I'm trying to render a BMP image to a 7-color waveshare display.
The
embedded-graphicshas support for BMP images using thetinybmpcrate, and it allows to specify a color space (egBmp::<OctColor>::from_slice(...)) butOctColorneeds to implementFrom<Rgb555>andFrom<Rgb565>.Right now this crate implements only
From<embedded_graphics_core::pixelcolor::Rgb888>.The implementation could be similar to the Rgb888 one, that tries to find the closest colors.
I'd make a PR but sadly I'm not familiar with graphics at all.
Just for testing I created an implementation for
From<Rgb555>andFrom<Rgb565>that simply converts the value into Rbg888 and use its From implementation to convert the image.I tested it with this image from the Waveshare repo example that was already converted to the correct color table, and just worked. Of course it needs a better implementation but it works.