Crates.io | sharpened_bilinear |
lib.rs | sharpened_bilinear |
version | 1.0.0 |
source | src |
created_at | 2024-05-15 17:26:05.764758 |
updated_at | 2024-05-15 17:26:05.764758 |
description | Sharp bilinear image resizing in linear color space with premultiplied alpha. |
homepage | https://github.com/orekhoff/sharpened_bilinear |
repository | https://github.com/orekhoff/sharpened_bilinear |
max_upload_size | |
id | 1241300 |
size | 2,641,890 |
Sharpened Bilinear is an image resizing library and command-line tool that uses a modified bilinear interpolation algorithm to produce sharp, accurate results. It supports resizing with premultiplied alpha and operates in linear space to avoid brightness distortion.
To use Sharpened Bilinear as a command-line tool, install it with Cargo:
cargo install sharpened_bilinear
To use Sharpened Bilinear as a library, add the following to your Cargo.toml
:
[dependencies]
sharpened_bilinear = "1.0.0"
USAGE: sharpened_bilinear <INPUT> [OPTIONS]
ARGS:
<INPUT> Input file path (required)
OPTIONS:
--output PATH Output file path
--factor NUMBER Scale factor
--width NUMBER Output image width in pixels
--height NUMBER Output image height in pixels
Defaults:
sharpened_bilinear <INPUT> -o <INPUT>_resized.png -f 1.0
If only one of the keys '-w' or '-h' is given, the
the second dimension preserves the aspect ratio or
determined from the '-f' key if factor given.
let input_image = image::open("input.png").unwrap();
let resized_image: image::DynamicImage =
sharpened_bilinear::resize(&input_image, width, height).into();
resized_image.save("output.png").unwrap();
Sharpened Bilinear is licensed under the MIT License.