Graphic Design: How to Create Realistic Cast Shadows

Last fall, one of our seminar attendees, Wendy Oleston (who has now become a friend), contacted me and asked for a critique on a set of images she’d designed for worship. Over the course of worship, a picturesque park scene was transformed into a junkyard with discarded trash, couches, cars etc (pictured below).

Wendy did a really good job cutting those items out, but she was somewhat unhappy with how they¬?looked in the final scene. She said she knew there was a problem with them, but didn’t know quite what it was. She wrote:
“the couch and all the other trash look like they were placed in there, like that don’t quite belong. If they were softened a little, they may look more like they are part of the image.”
What was she doing wrong?
In looking at the image it only took me a moment to recognize that the items she’d pasted in (while nicely cut out and placed) did not have any cast shadows, which detracted from the realism of the scene.¬?I¬?lightened the objects a bit,¬?added some shadows and shot it back to her via email explaining the need for shadows.

She wrote back and it seemed she had an “ah-ha” moment after seeing the version I sent her. Being a dedicated and growing graphic artist, her next question was, “OK, so how do you actually do that?” I put together some instructions for her that I thought might be helpful for readers of this blog.
Casting the Shadow
First off, you have to determine which direction the light is coming from. When you’re placing images into a scene look at the other shadows and the direction they’re being cast. Also look at highlights on other objects in the scene for clues on where to put your shadows.




If you’re creating something from scratch. you can make up the light location on your own. The shadows will then cast in the same direction as the light (see left).
So in the example here, the light is on the right, the shadow will appear on the left. Likewise if the light is on the right, the shadow should appear on the left. Same applies with the light being in front or behind the object.
The lower the light source the longer the shadows will be, and the higher the light is the shorter they will be. As pictured here:
¬?



Generally speaking, the part of the cast shadow
furthest from the light will be the lightest/most diffused (blurriest) part of the shadow. The part closest to the object will be the darkest and most sharp part (pictured right).
Creating the Shadow
As far as how to technically achieve a realistic cast shadow, there are many ways to pull it off, but one of the simplest is to work from the shape of the object itself.
In the example below, I cut out and pasted in a boat from one of the graphics in our library (fishing boat on Spark volume 4).
In Photoshop, Elements (or similar programs), load the selection from the layer you’re trying to cast a shadow from. In Photoshop/Elements hold the command key (Mac) or control key (PC) and click on the thumbnail window in the layer palette. This will create a selection (marching ants around the object).

Create a new layer, and fill the selection with black.

Before I go any further, I should say that shadows are many times more complex than they look. It is very rare that a realistic cast shadow is made up of one layer. I usually use 3 or more layers to build a shadow so keeping that in mind, we’ll tweak on the first layer and will hit the others in a moment.
If the layer you created in the previous step (the black shape) is on top of your object, reorder the layers to place it beneath. From there, you’ll want to keep in mind where the light is coming from, and using the free transform (command or control- T) you’ll want to “squash” and stretch the object to create a realistic cast. Depending on the object you might skew it slightly, or you might add some perspective by adjusting the nodes on the free transform bounding box. This isn’t an exact science so you have to play around with it until you get something that just feels right.

Shadows are typically soft on the edges, so you’ll want to blur the shadow slightly. I’ve found over time that motion blur (FILTER>BLUR>MOTION BLUR) creates a really nice cast shadows because it’s not uniform and creates some nice diffusion effects. Just set the angle to match the direction the light is coming from. I can’t give you a specific blur amount; you have to play with that number and see what looks best.

I will sometimes run a very slight Gaussian blur (FILTER>BLUR>GAUSSIAN BLUR) to finish off the shadow. When you’ve got something that looks about right, you’ll probably want to drop the opacity down a bit, and finally you can come in with a very large eraser to brush off the parts of the shadow that are furthest from the light and object.

Fine Tuning the Shadow
The shadow that results from those steps is a good start, but as stated above, I like to use multiple layers for a more realistic look.
From here I’d follow the steps above, only this time I’d scale the object to be about half the size as the original shadow layer I created.

I’d then blur it significantly to create a blend from it to the larger shadow. Lastly, I’d shift the position of this shadow to reflect where the light is coming from. In other words, if the source light is above right, I’d shift the position of this new shadow slightly to the right, if left, slightly left and so on. To finish it off, adjust opacity until it looks right.
Lastly, when you look at an object under lights there is typically a hard very thin shadow where the object makes contact with another object. So for instance, a cup sitting on a kitchen table would have a dark thin shadow just under the base. This shadow really helps “sell” the object being in the physical space. It’s important to keep it somewhat limited and even a bit un-uniform. I sometimes go in with an eraser and knock parts of it off slightly to add to the realism. Rarely in nature are objects perfectly shaped/straight etc.

The finishing touch here is to go in and fix the “perfect” shadows. I went in with a 50 pixel soft eraser and brushed off the edges a bit so it looked like the shadow matched the groves in the sand.
If you’d like to see the photoshop file I made in this example, you can get it here (must be logged in):
Boat Shading PSD (38)¬?
Continuing Ed
The last piece of advice I gave Wendy was to spend some time observing the ways light, shadows and object interact. Call me weird, but I love to look at shadows and light. I often find myself looking at the interplay of light and shadow, wondering how I might recreate those things digitally from scratch.
A really good observation exercise is to sit an object on a table with a portable lamp near by. Move the lamp around (up, down, side to side) and watch how the shadows change. Notice how the positioning of the light effects the diffusion, intensity, opacity and shape of the shadows.
To fully understand and perfect your ability to create realistic shading and shadows, you might consider taking a drawing class, or checking out some books on pencil drawing.





Wendy said,
Wrote on February 20, 2009 @ 4:22 pm
This is great stuff!!!! I know this is what will make my graphics look way more realistic but I can tell it’s gonna take some practice. It is fair to say, shadowing “scares” me a bit – but you’ve really broken it down so… thank you. I’ll let you know my progress! Thanks Jason!!!! and by the way – LOVED your seminars!!!! You guys are the BEST!
osborn4 said,
Wrote on March 25, 2009 @ 11:34 am
Good stuff. I’ve been using a Gaussian blur. But I can see that the motion blur would certainly have it’s advantages.
And going that extra 2 steps are ones I haven’t heard before, but make a lot of sense.
Thanks.
JIm Galbreath said,
Wrote on March 25, 2009 @ 11:50 am
What a great explanation of creating shadows! I’ve seen them and know they should be there, but how to make them something other than senseless blobs was not clear to me. This step-by-step tutorial is extremely helpful!
Thanks much and blessings on your continued ministry!