Does anyway have a single command for adding a 3 sided drop shadow? I have an unbelievably ugly solution, but feel sure magick users with more skills than me could do better.
Feel free to laugh at my code, I'm sure it's overly engineered and the completely wrong way to go about things with imagemagick... I'm a java guy after all...
Code: Select all
function addShadow {
OW=$(identify -format "%w" $1)
OH=$(identify -format "%h" $1)
convert $1 \( +clone -background $col -shadow $FILTER_R \) +swap -background none -mosaic /tmp/sr.png
NW=$(identify -format "%w" /tmp/sr.png)
NH=$(identify -format "%h" /tmp/sr.png)
WD=$[$NW - $OW]
convert -page +$WD+0 $1 \( +clone -background $col -shadow $FILTER_L \) +swap -background none -mosaic /tmp/sl.png
WS=$[$WD + $WD]
WR=$[$OW - $WS]
convert /tmp/sl.png -gravity West -crop $WS\x$NH+0+0 /tmp/tl.png
convert /tmp/sl.png -gravity West -crop $WR\x$NH+$WS+0 /tmp/tm.png
convert /tmp/sr.png -gravity East -crop $WS\x$NH+0+0 /tmp/tr.png
convert -depth 8 +append /tmp/tl.png /tmp/tm.png /tmp/tr.png $1
rm /tmp/tl.png /tmp/tm.png /tmp/tr.png
}