Content-aware image resizing

There is currently a lot of hype around this paper by Dr. Ariel Shamir and Dr. Shai Avidan. Honestly — it really kicks ass. This is a realy nice idea and I can absolutely understand Adobe just hired one of them direclty. Now there is a online demo of this available. Unfortunately it misses some source-code to look into and possibly optimize it.

So I did my own version. Basically this is a slim-version of the original technique. Image is converted to grayscale and a convolution matrix is used to find the pixel’s energy levels. Then the seams are created as the paper describes it … sort of :-). At the end the seam with the lowest energy is picked and removed.

The code is very ugly, not documented at all and not optimized. But it is also saturday night and I should be out drinking a beer already. You can press a key in the online demo to change the scale direction or click to reset it. If you can improve something do not be shy and post it.

Update: Here is another demo that shows the effect even better.

Update 2: Make sure to follow the joint venture from Mario and me.

Related Posts

11 Responses to “Content-aware image resizing”


  1. 1 Irmgard

    Hi,
    If you are looking for a software to try out seam carving, maybe you also want to take a look at http://www.thegedanken.com/retarget

    The program that you can download there (for Windows and Linux, and free) is already highly optimized concerning speed, and apart from enlarging or decreasing image size you can also use masks to protect or delete certain parts of your image.

    Have fun,
    Irmgard

  2. 2 reshade

    The demo shown are quite impressive and the source code is too clumsy one. Let me give a try again and then a nice comment here.

  1. 1 Links: September 3, 2007 « SmoothSpan Blog
  2. 2 lessrain blog » Blog Archive » Seam Carving for Content-Aware Image Resizing
  3. 3 dabu's blog » Blog Archive » seam carving - flash demo
  4. 4 Seam Carving, les plugins | Korben's Blog
  5. 5 A Source Of Inspiration - Flash Seam Carving
  6. 6 Content-aware image resizing
  7. 7 Levysoft » Rsizr: web application in flash per applicare online la tecnica per il ridimensionamento intelligente delle immagini e guida su come eliminare una persona da una fotografia in 3 mosse
  8. 8 Remote Sensing Tools
  9. 9 seam carving bis repetita | HIDIHO!

Leave a Reply






Close
E-mail It