In Photoshop the Gradient Map effect maps the colors of a gradient (defined by you) to the luminance values of an image. It doesn't get used all that often but it's quite a powerful and fun color correction tool which can produce some pretty nice results.
You can use it in two ways: firstly as a permanent image adjustment found by going to Image > Adjustments > Gradient Map. (watch out as you can't undo this!) Secondly'"a much more powerful alternative'"as an Adjustment Layer which you'll find in the Adjustments panel (CS4 and above).
Here's a rather offensive demonstration! I have a Layer with a circular white-to-black gradient:
If I apply the Gradient Map adjustment layer and edit the gradient to a rainbow I now have this monstrosity!
Well you get the idea. The left-hand side of the gradient (Red) is mapped to the darkest pixels and the right (Yellow) is mapped to lightest pixels. All the colors in-between are mapped to the values between dark and light (their luminance).
So here's some applications. Firstly it's quite a good tool for re-coloring textures. Here I have a typical grungy texture.
Now the first thing you'd think of when coloring something like this is Hue and Saturation. You'd click Colorize and adjust the Hue slider to get your color, like this.
You can see everything is now a shade of blue. That's cool but the Gradient Map can give you a lot more option when re-coloring. Here's the same texture with the Gradient Map Adjustment Layer applied:
I now have a lot more options for how I color the various luminance values of the texture. You can see the highlights are a now a creamy tan color. It's quite subtle but you can experiment and get as crazy as you like. So, that's one way you can use it.
Here's another very nice technique for this that uses a very powerful feature of Adjustment Layers: Opacity! I have a picture here that I got from iStockphoto. I can use the Gradient Map Adjustment Layer to give this photo a nice retro feel.
I'll apply the Gradient Map layer and edit the gradient to these colors, dark purple through some blue green shades and then to white:
I get this which is totally over the top!
Now if I dial down the opacity of the adjustment layer to about 67% I get a much more pleasing and subtle effect. The girl now takes on those nice purple and cyan tones and the green of the trees are really muted.
This ability to blend the Adjustment effect is very cool and will allow you to really fine tune your result!
Now all I have to do is add some subtle desaturation, lens blur and some vignette effects.
I've now got myself a nice looking retro style image:
Of course using different gradient colors will give different results so feel free to experiment there! These are just a couple of examples of what you can do with the Gradient Map in Photoshop CS5!