magnify

Crates.iomagnify
lib.rsmagnify
version0.1.0
sourcesrc
created_at2023-07-03 12:34:40.127972
updated_at2023-07-03 12:34:40.127972
descriptionSimple pixel-art scaling algorithms
homepage
repositoryhttps://github.com/ahi6/magnify-rs
max_upload_size
id906961
size24,350
(ahi6)

documentation

README

Magnify-rs

This is a rust library implementing some simple Pixel-art scaling algorithms.

Currently supported algorithms

  • Scale2x, Scale3x
  • Eagle
  • Nearest neighbor scaling

Example

This code scales image.bmp using the Scale3X algorithms and then saves the result into converted.bmp.

use image::io::Reader as 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(())
}
Commit count: 19

cargo fmt