| Crates.io | image-gameboy |
| lib.rs | image-gameboy |
| version | 0.1.0 |
| created_at | 2025-04-24 19:22:27.758844+00 |
| updated_at | 2025-04-24 19:22:27.758844+00 |
| description | Convert images to Game Boy-compatible 2bpp format |
| homepage | |
| repository | https://github.com/LinusU/image-gameboy |
| max_upload_size | |
| id | 1647712 |
| size | 15,975 |
A simple Rust crate for converting images into the Game Boy's 2 bits-per-pixel (2bpp) tile format.
Built to work seamlessly with the image crate.
into_gb2bpp() extension method on DynamicImageCargo.toml[dependencies]
image = "0.25"
image-gameboy = "0.1"
use image::io::Reader as ImageReader;
use image_gameboy::GameBoy2bpp;
fn main() {
let img = ImageReader::open("assets/sprite.png")
.unwrap()
.decode()
.unwrap();
let gb_data = img.into_gb2bpp();
std::fs::write("sprite.2bpp", gb_data).unwrap();
}
The original Game Boy used a tile-based graphics system where each 8×8 tile is represented by 16 bytes:
This crate generates exactly that format from any grayscale image.
Licensed under the MIT License or Apache 2.0.