7 releases
0.2.3 | Apr 19, 2020 |
---|---|
0.2.2 | Jan 22, 2020 |
0.2.1 | Jul 9, 2019 |
0.1.0 | Jul 6, 2019 |
0.0.2 | Jul 6, 2019 |
#1014 in Images
1.5MB
522 lines
seamcarving
A rust library for content-aware image resizing using seam carving.
How to use
Open an image using the image crate,
then use the resize
function from this create to create a smaller version
of the image, while preserving its contents.
let img = image::open("input.jpg")?;
let (width, height) = img.dimensions();
let resized = seamcarving::resize(&img, width/2, height);
resized.save("resized.jpg")?;
Detailed code example
- resize.rs : command-line image resizing
Results
Original | Resized |
---|---|
lib.rs
:
Content-preserving image resizing in rust
The main function of this crate is [resize]: it takes an image, and removes horizontal and vertical seams until it fits a given size.
Dependencies
~5MB
~60K SLoC