Crates.io | embedded-mono-img |
lib.rs | embedded-mono-img |
version | |
source | src |
created_at | 2025-03-20 00:03:20.636262+00 |
updated_at | 2025-03-22 13:03:53.229241+00 |
description | Convert .png images to raw binary for embedded_graphics |
homepage | |
repository | https://github.com/kpcyrd/embedded-mono-img |
max_upload_size | |
id | 1598733 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This program is for use with
embedded_graphics
to convert a .png
into the data needed/used for ImageRaw::<BinaryColor>
during embedded
firmware development with Rust.
embedded-mono-img -o img.raw img.png
const IMAGE: ImageRaw<BinaryColor> = ImageRaw::new(include_bytes!("../img.raw"), 24);
The file is recommended to be in 8-bit Grayscale.
In the past I used imagemagick like this:
convert frame1.png -monochrome -negate frame1.pbm
# use a hex editor, search for start of null bytes
tail -c +11 frame1.pbm > frame1.raw
However the exact offset for the tail
command varied depending on the
presence of metadata (like e.g. a comment). This problem has inspired
development of embedded-mono-img
so I don't need to worry about this anymore.
MIT OR Apache-2.0