#pixel-art #graphics #nearest-neighbor #scale2x

magnify

Simple pixel-art scaling algorithms

1 unstable release

0.1.0 Jul 3, 2023

#776 in Images

22 downloads per month

EUPL-1.2

11KB
191 lines

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(())
}

Dependencies

~13MB
~60K SLoC