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

magnify

Simple pixel-art scaling algorithms

2 unstable releases

0.2.0 Aug 7, 2024
0.1.0 Jul 3, 2023

#342 in Images

Download history 7/week @ 2024-08-10 13/week @ 2024-09-14 12/week @ 2024-09-21 3/week @ 2024-09-28 1/week @ 2024-10-12

70 downloads per month

EUPL-1.2

11KB
190 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::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

~2.5MB
~53K SLoC