This is a rust library implementing some simple Pixel-art scaling algorithms.
- Scale2x, Scale3x
- Eagle
- Nearest neighbor scaling
This code scales image.bmp
using the Scale3X algorithms and then saves the result into converted.bmp
.
use image::ImageReader;
use magnify::Algorithm;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let img = ImageReader::open("image.bmp")?.decode()?;
let converted_img = magnify::convert(img, Algorithm::Scale3X);
converted_img.save("converted.bmp")?;
Ok(())
}