image: remove the palette
add encode and decode
initial commit
This package provides an implementation of the BMP Image Format. Only the 8bpp with 256 palette, 24bpp and 32bpp formats are supported.
https://www.digicamsoft.com/bmp/bmp.html
https://en.wikipedia.org/wiki/BMP_file_format
make install
git subtree -P vendor/hare-bmp/ add https://git.sr.ht/~pierrec/hare-bmp main
use image::bmp;
use io;
fn run(src: io::handle, width: u32, height: u32, pixels: []u8) (void | io::error) = {
const img = bmp::image {
width = width,
height = height,
pixels = pixels,
...
};
bmp::encode(src, img)?;
};
use image::bmp;
use io;
fn run(src: io::handle) (void | bmp::error) = {
const img = bmp::decode(src)?;
};