Saturday, April 7, 2007

Photoshop Tutorial: Glossy Buttons

Create some shiny glossy buttons for your website's menu system. This tutorial illustrates how to add a glossy finish to your buttons or other nifty shapes.

Start with a new image about 400x400 pixels with a background color of your choice, (the example uses white). Make any kind of wacky shape you'd like for your button (for this tutorial I will show you one particular shape, though you can use any shape you can imagine). Start by creating a new layer and using the Rectangular Marquee Tool to draw a rectangle roughly the size you want your button to be.

Open the Channels palette and create a new channel. Fill the selection in with white, and deselect (CTRL+D). Now go to Filter » Blur » Gaussian Blur and use a setting of about 3.5. Click OK. Next go to Image » Adjust » Levels and drag the two bottom triangles towards the center until the button looks nice and smooth (see the example below). Click OK when done. Hold CTRL and click on the "Alpha 1" channel to select it. Click the Layers tab to return to the Layers Palette.

Create a new layer, make that layer current, and then fill your selection with your chosen color (the example uses R:255 G:126 B:0), and deselect (CTRL+D). Now to make the button more interesting go to Edit » Transform » Perspective. Drag the bottom right point inwards so that your button is shaped similar to the example (or of course feel free to experiment with other shapes).
Now, to make the highlight, create a new layer. Using the Freeform Pen. Ensure that the "Paths" options is selected in the Options bar, and not "Shape Layers". Draw a rough wiggle circle around the top of the shape as seen in the example. Once you have your path, right click and choose "Make Selection" - use the default settings. If the path is still visible under the selection, right click again and choose "Delete Path". Now create a new layer and fill the selection in with white.
Next hold CTRL and click on "Layer 1" to select it. Go to Select » Modify » Contract and enter 1. Now go to Select » Inverse. Make sure you have "Layer 2" active and hit delete. Now hold CTRL and click on "Layer 2" to select it then hit DELETE about 4 times to completely get rid of the white. Do not lose the selection.
Now press D then X to reset the colors. Select the Gradient Tool and ensure that it is set to Linear mode. In the options tab change the gradient type to "Foreground to Transparent" and drag the gradient from the top of the selection to the bottom. You should now get a highlight effect. If you'd like you can save the selection for later use by choosing Select » Save Selection » OK. Then press CTRL+D to deselect. If the bottom of the highlight isn't as well-blended into the rest of the button as you'd like, choose Filter » Blur » Gaussian Blur and add as much blur as needed to soften the edge of the highlight.
You have the highlight, now you need the dark shadow. Do the same as before, using the Freeform Pen draw a wiggly line across the bottom of your button (see the example). Again, right click and choose "Make selection", use default settings, and if applicable, right click and choose "Delete Path". Now create a new layer - don't lose the selection.

Create a new layer, select the layer and fill the selection with black. Hold CTRL and click on "Layer 1" to select it. Go to Select » Modify » Contract and enter 1. Then, go to Select » Inverse and with "Layer 3" active in the layers palette, hit delete. Now hold CTRL and click on "Layer 3" to select it, hit DELETE about 4 times to remove all the black - do not lose the selection.

Now set black as your foreground color, and using a the Linear Gradient at foreground to transparent still, drag from the bottom of the selection to the top (you may want to drag from a spot a bit below the selection and stop right at the top, so that the gradient won't appear too dark). Then Deselect (CTRL+D). Now you may want to blur the black shadow a little using Filter » Blur » Gaussian Blur (the example uses a setting of 3.0, with the layer's opacity lowered down to between 40-60). The button is now complete, so if you'd like to add a drop shadow at this point, select "Layer 1" and choose Layer » Effects » Drop Shadow, and adjust the settings to your preference.
When you add text make it the same color as the button but a lot darker. To make it look like it's inset into the button's surface, make a copy of the text layer by dragging it to the New Layer icon in the Layers Palette. Drag the new copy layer below the first text layer and change the color of the duplicate text to white. Hold down CTRL to temporarily enable the Move Tool, and using the arrow keys on your keyboard, move it up a pixel and left a pixel. Set the layer blend mode to "Color Dodge". Go to Layer » Type » Render Layer (or depending on your version, right click on the text and choose Rasterize Type), and then Filter » Blur » Gaussian Blur, choose a setting of about 1.0. Finally, turn the bottom text layer's opacity down to about 50% and you're done.