xbr 0.1.0

A pixel art upscaler
xbr-0.1.0 is not a library.
Visit the last successful build: xbr-0.2.4

xBR x2 Filter in Rust

Pixel Art Upscaler

Checklist

  • Make into a library
  • x3 and x4 versions
  • Resizing
  • Indexed PNG format

Examples

Run Command

cargo run --release -- ./assets/in1.png ./assets/out1.png

Resources

Projects

Resizing

[dependencies]
image = "0.23.0"
use image::{DynamicImage, GenericImageView, imageops};

fn resize_image(image: DynamicImage, new_width: u32, new_height: u32) -> DynamicImage {
    image.resize_exact(new_width, new_height, imageops::FilterType::Triangle)
}

fn main() {
    // Open the image using the `image` crate
    let image = image::open("path/to/your/image.jpg").expect("Failed to open image");

    // Set the desired new width and height
    let new_width = 800;
    let new_height = 600;

    // Resize the image using linear sampling
    let resized_image = resize_image(image, new_width, new_height);

    // Save the resized image to a file
    resized_image.save("path/to/save/resized_image.jpg").expect("Failed to save image");
}