Skip to content

Seam carving for image retargeting and content-aware resizing

Notifications You must be signed in to change notification settings

pnwheeler/seam-carving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seam Carving

What

Seam carving is a method for implementing content-aware resizing or image retargeting. It aims to reduce the height or width of an image without losing information or altering the subject's proportions, major drawbacks of cropping and unlocking aspect-ratio respectively.

Drawbacks

Without image segmentation or consideration for edge gradient direction, removing too many seams from a "busy" picture is likely to result in output warped beyond recognition. I did include a masking tool to select portions of an image you'd like protected. Below is an example of the process with and w/o a mask:

Mask No Mask
Masked No mask

Usage

Compile with makefile
Requires CImg.h, ImageMagick for image types

Options

command description
-i (char*) input path/to/image
-o (char*) output path/to/save
-p (int) percentage of image to resize by
-m (bool) whether or not to apply mask

About

Seam carving for image retargeting and content-aware resizing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages