Codewalkers.com has a new tutorial today concerning the use of drop-down shadows on images - and just how easy GD makes it to add them to anything.
Imagine a scenario where you have an online photo album and the layout calls for drop shadows to be placed behind each image. It would be a hassle to manually add the shadow to each image... and actually modifying the original picture might not be possible depending on the circumstance. But if there're a few extra processor cycles available on the server, why not script the shadow using PHP?
The idea is simple: take the original image, create a slightly larger new image, draw a shadow on the new image, overlay the original image and send the results back to the requesting client. The drop shadow is be added on the fly!
They step you through all of the options and code that you'll need, including a rather cool way to create the gradient effect for the edges of the image (using a few pre-defined variables). And, of course, they have the entire code for you to check out - as well as a sample image.




