magnify

Crates.iomagnify
lib.rsmagnify
version0.2.0
sourcesrc
created_at2023-07-03 12:34:40.127972
updated_at2024-08-07 11:08:19.607703
descriptionSimple pixel-art scaling algorithms
homepage
repositoryhttps://github.com/ahi6/magnify-rs
max_upload_size
id906961
size24,403
ahi (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::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