img-qoi

Crates.ioimg-qoi
lib.rsimg-qoi
version0.1.0
sourcesrc
created_at2021-11-30 03:09:22.418732
updated_at2021-11-30 03:09:22.418732
descriptionQOI (Quite OK Image) manipulation library
homepagehttps://github.com/taotao54321/img-qoi
repositoryhttps://github.com/taotao54321/img-qoi
max_upload_size
id489593
size81,672
(taotao54321)

documentation

https://docs.rs/img-qoi

README

QOI (Quite OK Image) manipulation library

Examples

Convert QOI to PNG (with image crate):

use image::RgbaImage;
use img_qoi::*;

let (desc, buf_rgba) = qoi_open("foo.qoi", QoiChannels::Rgba)?;

let img = RgbaImage::from_vec(desc.width().get(), desc.height().get(), buf_rgba).unwrap();
img.save("foo.png")?;

Convert PNG to QOI (with image crate):

use std::num::NonZeroU32;
use img_qoi::*;

let img = image::open("foo.png")?;
let img = img.to_rgba8();

let desc = QoiDesc::new(
    NonZeroU32::new(img.width()).unwrap(),
    NonZeroU32::new(img.height()).unwrap()
);

// `RgbaImage` implements `Deref<[u8]>`.
qoi_save_from_buffer("foo.qoi", &desc, &*img, QoiChannels::Rgba)?;

License

MIT

Commit count: 9

cargo fmt