When designing graphics for themes and skins in Photoshop I frequently find myself centering the contents of one layer within the contents of another layer (like nested circles). Although the steps to accomplish this are simple, rather than wading through menus one could easily create a Photoshop Action, or macro, to accomplish this feat. Here’s how I do it:
My Action created for Photoshop 6.0 essentially just performs steps 2-4, giving me the flexibility of choosing the are to center to before starting the action.
I’ve also set my action to be triggered by the F9 key, so I can make the selection to center in, click the layer to center, and then press F9. One could just as easily create an action to center to the entire page.
In this example I’ve created a new Photoshop document (Ctrl/Apple+N) and set its dimensions to 140×140 pixels and set its background to white. Resolution you can leave at the default, it’s irrelevant in this example.
In this new file I’ve created two new layers (Ctrl/Apple+Shift+N) containing the following items:

You can see in the above image that the two circles are placed kind of randomly in the image. We want to center these using the technique given above.
To vertically center the orange circle over the green one I Ctrl/Apple+clicked the layer containing the green circle. This creates a selection area based on the contents of the clicked layer, in this case, the green circle. Then I clicked on the layer containing the orange circle to activate it so when we use the menu options, this is the layer that will be moved. Now, navigating through the menus I selected the following options: Layer > Align to selection > VERTICAL Centers, giving us the following image:

Of course, I want the orange circle COMPLETELY centered within the green one. We do essentially the same thing as above, keeping the selection area based on the green circle, clicking the orange-circle containing layer, only this time we navigate to Layer > Align to selection > Horizontal Centers

That’s an easy success now, isn’t it? Let’s take it a step farther, however, to demonstrate the scope of this technique. In the steps so far we have centered a smaller object within a larger one. What about centering larger objects around a smaller one? Works exactly the same!
Below you will see that I’ve added a fuschia dot in the lower right quadrant of the image. It’s created on a new layer over both of the other two and the circle is 10px in diameter.

To center the other two circles around this little dot, perform the following steps, or use an action recorded by these steps as advised earlier.
The orange circle should now be centered around the fuschia dot as follows:

Execute the same steps, only in step 2, select the layer containing the green circle instead.

Axeman747
Aug 15, 11:52 PM | Permalink