using command line imagemagick, version 7.0.8-34 on Mac. The drop shadow is pretty straightforward with -shadow command. The elongated shadow is giving me troubles.
Given the inputs foreground.png (That has transparent bits to it, and the alpha channel set), background.png, and size…
The first strategy I tried to use was a custom -fx to output the maximum alpha value between the source pixel and the pixel immediately west and north of the source pixel:
Code: Select all
magick foreground.png -channel A -fx 'min(max(p.a, p[-1,-1].a),0.04)' -channel-fx 'red=0 green=0 blue=0' shadow.png
The second strategy relies on -motion-blur. Motion blur the foreground in a certain direction, even out the alpha, then blacken the result:
Code: Select all
magick foreground.png -channel-fx 'red=0 green=0 blue=0' -channel A -motion-blur "0x$magicSigma+215" foreground.png -fx 'ceil(u.a) - 0.96 - (0.04 * v.a)' -blur 0x2 shadow.png
Any suggestions as to how I can improve either method?