Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lovasoa/seamcarving
Seam carving implemented in rust
https://github.com/lovasoa/seamcarving
image image-processing rust-library seam-carving
Last synced: 3 months 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T22:26:36.000Z (almost 5 years ago)
- Last Synced: 2024-10-05T22:05:31.102Z (4 months ago)
- Topics: image, image-processing, rust-library, seam-carving
- Language: Rust
- Homepage: https://crates.io/crates/seamcarving
- Size: 2.77 MB
- Stars: 11
- Watchers: 2
- Forks: 4
- 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
## ResultsOriginal | Resized
--- | ---
![waterfall original](./examples/waterfall.png) | ![waterfall resized with liquid rescaling](./examples/waterfall_resized.png)
![butterfly original](./examples/butterfly.png) | ![butterfly resized with liquid rescaling](./examples/butterfly_resized.png)