https://github.com/pgdr/seam-carving
https://github.com/pgdr/seam-carving
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pgdr/seam-carving
- Owner: pgdr
- Created: 2025-11-04T09:23:56.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-11-04T09:29:19.000Z (7 months ago)
- Last Synced: 2025-11-04T11:25:17.837Z (7 months ago)
- Language: Python
- Size: 316 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Seam Carving Program
The Seam Carving program applies a dynamic programming approach to
resize images by removing low-energy "seams", enabling content-aware
resizing with minimal distortion. It identifies *seams*—paths of least
energy vertically through the image—by computing pixel energy from
intensity gradients.
## Example
When run on this image, with width 400 (currently 539) one can observe
that almost no information is lost

only bits of Bare Egil, leading to an even more Bare Bare Egil:

## Requirements
- `PIL` (Pillow) for image processing
- `numpy` for numerical operations
- (optional) `tqdm` for progress visualization
## Usage
To run the program, execute the following command in the terminal:
```
python seam.py
```
- ``: Path to the image file you want to resize.
- ``: The desired width for the output image.
### Example
```
python seam.py input.jpg 300
```
This command will resize `input.jpg` to a width of 300 pixels, while
keeping the aspect ratio intact by removing the least important seams.