Saturday, December 22, 2007

How to carve a cat

Seam carving is a new technique for content-aware resizing of images. The idea is to squeeze the images without reducing them. An audio analogy would be speeding up a recording without changing the pitch.

The alternatives to seam carving are cropping and shrinking. Cropping loses information at the edges. Shrinking loses detail everywhere. Seam carving analyses the picture and deletes "unimportant" information.

Of course, I can't just read about something like this, I have to download some software and try it for myself. Here is a feral cat, 400 pixels wide:

400px-Feral_cat Now we progressively carve the picture.

350Cat

300Cat

250cat

200Cat

Now the picture is half size. Ouch! The head and tail are about the same size as in the original, and it looks like the algorithm decided that dark shadows, blurry green leaves and white fur were "unimportant" information. The cat's adorable face is preserved. Which makes a certain amount of sense. To me. Maybe not to the cat.

No comments: