Seam Carving for Content-Aware Image Resizing

closePlease note: This post was published over a year ago, so please be aware that its content may not be quite so accurate anymore. Also, the format of the site has changed since it was published, so please excuse any formatting issues.

There’s a sad truth about clients that every web designer knows: If you give them the keys, they’ll crash the car. By that I mean, if you design a site for a client, as soon as they’re allowed to start populating the site with content, they’ll manage to add content that screws up your design. The design that took you days, possibly weeks to perfect.

This is particularly true for pictures. When clients are allowed to upload whatever size of image they want, problems will eventually arise. You can write an instruction manual as thick as a novel, but the client won’t read it, and even if they do, at some point, they’ll ignore it for the sake of convenience.

To combat this, programmers like to impose restrictions on what type, size, or shape of images can be used. For example, the CMS I use at the place we don’t blog about, which was created by other people, only allows images with an aspect ratio of 4:3 to be uploaded, and even then, the images must be either 640×480, 400×300, or 320×240. That’s it. Three choices for size, all of which _must_ conform to a particular aspect ratio. What if I wanted to upload an image with a 3:4 ratio? What if I want to associate an image to a story, but the only image I have is in some other aspect ratio and I can’t make it conform without cropping out an important part of the photo?

Clearly, restricting the client isn’t the way to go. The DOM gives us some options, but then we’re punishing the user by forcing her to wait for a framework to load (and we’re relying on Javascript to format the page, which has numerous drawbacks).

So what options are available to a webmaster trying to maintain control over the design of a site? Well, the video below was recently at SIGGRAPH. It may not be the best option (in fact, at the moment, it’s not an option), but it’s damn cool!

0 People like this. Be the first!

1 Comment

  1. Tom Dineen

    WOW! This imagine the application of this in alteriing security video. I can see the CSI episode now where the video tech discovers the tape is altered and resurects the removed images to reveal the criminal… Wait, didn’t they already do that one? There are so many episodes of So many cities. It’s all a blur!

Leave a Reply