One of the interesting applications of image processing on the web is what is called “Seam Carving”. The idea is that it is possible to identify areas of an image that can be added/removed as an image is resized. This means that when downscaling, instead of reducing the size of the full image, regions are taken out. On the flip side, when upscaling, either regions are added, or inpainting is used to extend areas.
There is a video that explains the technique in mode detail from the Siggraph presentation, and several image processing applications have implemented it. GIMP happens to have an implementation of this algorithm (called Liquid Rescale), so I gave it a try to see how well it works.
Below is our test image, which is a shot taken at the summit of Little Si. Using Liquid resize, I first tried to reduce the image to about half the width. The output was a decent image (regarding the inpainting job). The blending of the background (which does not have clear unique shapes) was good, but when it came to the subjects of the photo, it is clear that the algorithm can’t really determine which areas are good to remove and which are not.
I tried next to provide feedback regarding areas to preserve. I decided to keep myself in the picture and make any other area eligible for removal:
Providing feedback definitely helped, though it ended up with a distorted view of my friend. That is where the opposite feedback of areas to remove comes into play:
Now I have a decent image. There are some artifacts still in the front, which are not uncommon with inpainting techniques, but in general I think the output is good. I tried to upscale the image to twice the size with no hinting first. Again, not indicating areas to preserve is not a good idea.
After providing a hint to preserve both my friend and I, the results were pretty good.
For modifying a 1600 x 1200 photo, the tool took about 4 seconds per operation, which is fine for an app, but not there yet for an interactive control for a web page. However, the biggest blocking problem I see is the need of feedback to get back useful results. I think that using Seam carving combined with a simple foreground/background detection algorithm can go a long way into automating the process.
The GIMP implementation seems pretty useful for doing photo and other edits, and Photoshop also has an implementation. To close on this, I tried using an insomart image. I liked the results, as it let me emphasize some of the image details while keeping the full background.