pic-scale-safe

Crates.iopic-scale-safe
lib.rspic-scale-safe
version0.1.6
created_at2024-10-17 22:29:49.318137+00
updated_at2026-01-09 15:45:05.701138+00
descriptionFast and safe performance image scaling
homepagehttps://github.com/awxkee/pic-scale-safe
repositoryhttps://github.com/awxkee/pic-scale-safe
max_upload_size
id1413671
size309,028
Bertie (github:cryspen:bertie)

documentation

https://github.com/awxkee/pic-scale-safe

README

Fast and safe image scaling in Rust

This crate provides zero unsafe fast rescaling.

Example

let img = ImageReader::open("./assets/nasa-4928x3279.png")
    .unwrap()
    .decode()
    .unwrap();
let dimensions = img.dimensions();
let transient = img.to_rgb8();

let src_size = ImageSize::new(dimensions.0 as usize, dimensions.1 as usize);
let dst_size = ImageSize::new(dimensions.0 as usize / 4, dimensions.1 as usize / 4);

let resized = resize_rgb8(&transient, src_size, dst_size, 
                          ResamplingFunction::Lanczos3).unwrap();

This project is licensed under either of

  • BSD-3-Clause License (see LICENSE)
  • Apache License, Version 2.0 (see LICENSE)

at your option.

Commit count: 68

cargo fmt