Drop-shadows in ImageMagick
Thus spoke Debra Douglass
I've notice several people here are familiar with the ImageMagick
tools. Could someone help me with a quick question? Could you tell me,
using Gimp or one of the ImageMagick tools, how to add a drop-shadow
to a jpeg image (preferably by command line) where the dimensions of
the image remain the same plus the shadow?
(width-orig-image + shadow-width) * (height-orig-image + shadow-height)
= new-image-width * new-image-height.
This assumes an image with only one layer to start with.
1. Add an alpha channel to your layer.
2. Add a new layer below your current one. Make it the color you want for
the background.
3. Resize your original layer down by X pixels in both width and height.
"X" is the offset you'll use for the drop shadow, which will default to 15
pixels (as you'll see later).
4. With your original layer selected, choose Script-Fu->Shadow->Drop Shadow
from the Canvas menus.
5. Make the offset match the "X" value from step 3. Make sure "Allow
Resizing" is *not* set.
The drop shadow will be created below your original layer but above the
background. You may want reposition your original layer. You can do that
using the Layers->Align Layers option.
This won't be exactly right the first time, but fiddle with the steps a
little and you'll get it right after a few tries.