Content-aware image resizing

December 14, 2007 | By | 2 Replies More

Check out this video.

Isn’t this exciting? This new technique is called seam carving.

Seam carving is an image resizing algorithm developed by Shai Avidan and Ariel Shamir. This algorithm alters the dimensions of an image not by scaling or cropping, but rather by intelligently removing pixels from (or adding pixels to) the image that carry little importance.

The importance of a pixel is generally measured by its contrast when compared with its neighbor pixels, but other measures may be used. Additionally, it’s possible to define (or autodetect) areas of high importance (faces, buildings, etc.) in which pixels may not be deleted, and conversely, areas of zero importance which should be removed first. From this information, the algorithm detects seams (continuous lines of pixels joining opposite edges of the image) which have the lowest importance, and deletes those. This shrinks the image by one horizontal or vertical line, depending on which direction the seam ran.

Seam carving can also be run in reverse by adding (interpolated) pixels along the lowest energy seam.

With this technique, it’s now possible to scale pictures by a large amount, while still retaining details. In normal Image scaling, scale factors greater than 2 or less than 0.5 usually result in visible image quality degradation.

For more scientific details go to Shamir’s website and take a look at the paper. And if you just can’t get enough, there’s also a larger version of the video on the website for downloading (I recommend this, the quality is much better and you can see more details).


Tags: , , ,

Category: photography, Technology

About the Author ()

I studied Horticulture, so officially I'm an agricultural engineer, but I'm doing something completely different at the moment. I want to get back into this field though. "Projektleiterin" is German and means project leader. My mom sometimes calls me like this for fun, because as a kid I used to start many many knitting projects very enthusiastically and then had trouble finishing them. On my knitting blog you can see proof that I'm now a much better person than I used to be. :D It may sound funny to those who don't knit, but while knitting is certainly a creative and pleasurable activity, it also teaches you perseverance and discipline. I'm also an extreme sucker for compliments on my knitting, so don't hold back! :D I'm never really sure what to tell people when they ask me where I'm from. Usually I say, "I grew up in Germany, but originally I'm from Asia." I think I'm quite conservative at heart, but liberal by choice. Oh, and be a bit forgiving if you read my posts - English is not my native language.

Comments (2)

Trackback URL | Comments RSS Feed

  1. Dan Klarmann says:

    I'm an old-timer who remembers when Compuserve began using LZW (gif) compression. Then came jpg a few years later. As a geek, I had to study how each of these works.

    This is something else, entirely. And free!

    Try it out yourself at <a rel="nofollow" href=""&gt <a href="http://;” target=”_blank”>; where a live Flash version runs in your browser on any picture you have.

  2. the chaplain says:

    This looks like a great technology. I'll have to follow Dan's link and try it out.

Leave a Reply