File Exchange

image thumbnail

Seam Carving for content aware image resizing

version (1.29 KB) by Aslak Grinsted
illustrative example of the seam carving algorithm.


Updated 27 Sep 2007

No License

Editor's Note: This was a File Exchange Pick of the Week

illustrative example of Seam carving for content aware image resizing

usage: carvedimg=seamcarving(im,k)

k is how many vertical seams to remove.
im is the image.

image([carvedimg img]);
axis equal;

Author: Aslak Grinsted 2007...
Based on ideas from Avidan & Shamir:
Note i haven't read their paper and they have probably lots of smart tricks for optimizations.

Cite As

Aslak Grinsted (2021). Seam Carving for content aware image resizing (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

aravindh raju

sir is it vertical seam carving is possible

Waheeb Yaqub

Joel Mendonca




Karthik MSwamy

Really nice piece of code. Works like a charm!

fido genial

great work!!! How do you increase the size of the image... I see only seam removal...

kkk kkk


fabrice clavel

Aslak Grinsted

It only requires image processing toolbox in order to load the demo images. Try loading one of your own and applying it to that instead. --Anyway i have tried to remove this dependency in a new version just uploaded.

Gerd Kunert

Requires Image Processing Toolbox!

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!