The problem is that you want your shadow down and to the right of the bounds of the image. The -layers composite does not allow you to expand the image beyond its bounds. So you have to -extent your image to accommodate the shadow. Here is an example. (Unix syntax)
Code: Select all
convert http://orig08.deviantart.net/03fe/f/2013/037/f/d/cry__poke_by_kiwa007-d5u29cm.gif \
-coalesce -write mpr:img -delete 0--1 \( mpr:img -gravity northwest -extent 200x200% \) \
null: \( mpr:img -background '#5E5E59' -shadow 55x12-20-10 \
-flip -virtual-pixel Transparent +distort SRT "%w,%h 0.75,0.25 0 %[fx:1.25*w],%[fx:1.25*h]" \) \
-background transparent -layers composite -trim +repage animation.gif
All the controls are in the +distort SRT. See
http://www.imagemagick.org/Usage/distorts/#srt for the arguments. I have flipped the image first, then applied +distort SRT. The first and last pair of coordinates account for the shift right and downward in proportion to the image size by 25% to the right and 25% to the bottom. The second and third arguments are the scaling (0.75,0.25 is 75%w,25%h) and the fourth 0 is no rotation. You mostly need to decide what scaling your want for the shape of the shadow and then just set the last two arguments in the %[fx: ...] to account for the shift right and shift downward. Note I expanded the image by 200% to make plenty of room for the shadow. If you shift the image too much (beyond a factor of two for the bottom), -layers composite will object. You can adjust the -extent to minimize the size, but need to allow enough room for the shadow. The -trim at the end removes the excess from the extent. You can use -border to pad it out some if you want.
I also swapped the images so that the extended original images were first in the command line and the shadow overlays were done after the null:
Note your -fuzz 2% at the end did nothing without a -trim.
Modify this as you desire.