Seam Carving: Compressing Scenes with Content-Aware Scaling
A common problem in photography is capturing an image in which two subjects in the scene are just a little too far apart to create a compelling composition; or the subject is a bit too far from one edge of the frame, but you don't want to crop away the edge content. Photoshop CS4 has introduced a fantastic way to bring things a little closer together, without creating obvious seams in the image.
The image in Figure 6 shows a sunset scene in which the boat is (subjectively) perhaps a bit too far away from the paddle surfer, especially if you'd rather have a more square format without cropping away all or part of the boat.
Figure 6 Previous versions of Photoshop wouldn't allow you to create a square "crop" of this image without cutting away part of the sailboat.
To achieve the look we want, make sure that you can perform a transform operation on the image; this means that the layer on which you're working cannot be locked. Next, select the areas of the image that you want to keep or protect from being "cut away." Once you've done that, you can access the Channels panel and click the Save Selection as Channel button (see Figure 7).
Figure 7 Select the areas you want to protect so that they appear in the final image, and create an alpha channel from those areas.
Access the transform function for seam carving by choosing Edit > Content Aware Scale. Transform handles appear around the bounds of the document, much as if you were using the Edit > Transform functions. From the Options bar, choose your alpha channel from the Protect menu. Grab the scale handles along one of the document edges and nudge inward as far as you can go before you see obvious distortions in the protected area; then back up a bit until the distortions disappear (see Figure 8). At this point, if you like the composition, click the checkbox on the Options bar or press Return. The transform should take a minute or two to complete, depending on your hardware.
Figure 8 Using the alpha channel to protect the important image areas, you can scale the document as you normally would with the Scale transform.
The last step: Crop away the transparent areas left behind by the transformation.
Voilà! You now have a brand-new composition without distortions and without losing important elements from the original shot (see Figure 9).
Figure 9 The final scaled image, with square format and sailboat fully intact.
There are some limits to what you can do with this tool, especially when you have to make oddly shaped alpha channels where important areas share part of the scene with less important details. In general, it's a lot of fun to use, and often produces compelling results with a bit of experimentation.