Archive for the 'Photography' Category

Content Aware Image Resizing

So say you want to include embed an image into your web page, like this one of my dad taken by my step-mom:

It’s not a bad image, but doesn’t quite have the same impact in this scaled down form factor. It would be nice if you could make my dad a little bit bigger. You could crop the image but then you lose the interesting expanse of the background. There is another technique… called content-aware image resizing that performs seam carving on the image. You might have seen the video created by the algorithms creators a while back. Since their paper was published various implementations have cropped up, including this Liquid Rescale plugin for GIMP by Carlo Baldassi. It works much like you would expect; create some additional layers with masks for important and unimportant features of the image, pick a target size, and go.

By not being too aggressive this is what I came up with:

I messed up the mask on his left foot so it started to distort and there is still a tiny trace of red from the date. Obviously this totally changes the aspect of features if you scroll and compare the two images, but that’s not important here. The goal is to produce an image for the target size (in this case 474 pixels wide) while maintaining the features and important information of the original image.

It works in the reverse direction, too:

It’s really fun to play with and it’s Free/Open Source Software, too!