// you’re reading...


Photoshop CS4: Content-aware scaling


What is it?

Have you ever noticed how print sizes and layout windows almost never correctly match the dimensions of your photo. This is particularly aggravating when you’ve composed your photo carefully and tightly. In the end, you have to sacrifice the quality of the photo to fit the crop.

The new Content-aware scaling promises to alleviate this problem by intelligently scaling an image to fit a given dimension without compromising the content of the photo. At least, that’s the promise. In practice, the use of Content aware scaling is a little more complicated.

The concept behind Content-aware scaling is to preserve areas with high details or visual importance while distorting the unimportant information to fit the new image dimensions. The problem is that you and Photoshop won’t always see eye to eye on what is important or unimportant detail in your photos. In this first image I was able to stretch the width of the image without too much difficulty. This is the ideal use of Content-aware scaling, making small adjustments to an image with a soft or repetitive background.


In the second image, the shortcomings of Content-aware scaling are more apparent (at least I hope so). Pushing and pulling my portrait shows me to be the pencil-headed geek I really am.


Why is it important?
Designers often have to stretch and clone images to fit a layout window or make room for text. Content-aware scaling is ideal for this purpose, particularly when the image is a simply-composed stock image with lots of blue sky or white space. A second potential use of Content-aware scaling is in the wedding and portrait industry where photographers are frequently asked to make their subjects appear thinner than they actually are. This is a quick way to slim the groom without a lot of heavy retouching. The Content-aware algorithm will preserve the detailed regions (eyes, smile, corset) while shrinking smooth tones (tuxedo, forehead).

Of course, the most popular use of Content-aware scaling will be to create cartoonish caricatures to show the true inner-self of our subjects.

Bonus Tip: Use A Mask: To improve the results of the scaling, build a mask around your subject. In the Content-aware scaling menu select your mask from the Protect pull-down menu.

Guest Post: James Dimagiba
When researching the origins of Content-aware scaling, my assistant James, who is far more mathematically inclined than I, unearthed some valuable information on how this feature works. For those of you wanting a technical background on Content-aware scaling, read on.

Traditional scaling in Photoshop has a tendency to distort all of an image and getting around it involved a tedious process of selecting regions and retouching. With the new content aware scaling, Photoshop is able to differentiate between reigons of high complexity and low complexity and adjust them so that an image can be rescaled without disrupting the proportions of the content. Additionally, Photoshop can automatically protect skin tones, preventing the distortion of people. Regions can also be manually protected by selecting regions and saving them as alpha channels.

You may be wondering how this is done. Content-aware scaling utilizes a technology called “seam-carving” which inserts or removes pixels based on their importance in a non-uniform manner, allowing the content to be preserved. Though this may not be the algorithim used by CS4, here is some information on how seam carving works. http://www.seamcarving.com/

For those a little more interested in the algorithm itself, here is another example of a seam carving algorithm, based on the work of Shai Avidan and Ariel Shamir.



No comments for “Photoshop CS4: Content-aware scaling”

Post a comment