https://github.com/lovasoa/seamcarving
Seam carving implemented in rust
https://github.com/lovasoa/seamcarving
image image-processing rust-library seam-carving
Last synced: about 1 year ago
JSON representation
Seam carving implemented in rust
- Host: GitHub
- URL: https://github.com/lovasoa/seamcarving
- Owner: lovasoa
- Created: 2019-07-04T20:14:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T22:26:36.000Z (about 6 years ago)
- Last Synced: 2025-03-19T01:59:54.852Z (about 1 year ago)
- Topics: image, image-processing, rust-library, seam-carving
- Language: Rust
- Homepage: https://crates.io/crates/seamcarving
- Size: 2.77 MB
- Stars: 11
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# seamcarving
A rust library for
**content-aware image resizing** using [seam carving](https://en.wikipedia.org/wiki/Seam_carving).
## How to use
Open an image using the [**image** crate](https://crates.io/crates/image),
then use the `resize` function from this create to create a smaller version
of the image, while preserving its contents.
```rust
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](./examples/resize.rs) : command-line image resizing
## Results
Original | Resized
--- | ---
 | 
 | 