php image reflection with gradient not working in imagemagick command line

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
phpnerd
Posts: 1
Joined: 2017-05-09T02:05:12-07:00
Authentication code: 1151

php image reflection with gradient not working in imagemagick command line

Post by phpnerd »

I have original image like this

https://ibb.co/d9hGRQ

After running these commands

convert image.jpg -scale 310x496\! scaled.png
convert scaled.png +clone -flip -crop 310x150 -compose Dst -composite out/shadow.png
convert -size 310x150 -alpha set gradient:rgba\(255,0,255,0.6\)-rgba\(255,255,0,0.50\) out/grad.png
convert out/shadow.png out/grad.png -compose Dst_Out -composite out/shadow_gradiented.png
convert shadow_gradiented.png out/shadowed.png -append out/final.png

I am getting output like this
https://ibb.co/hbGzfk

But I need output like this.
https://ibb.co/h1tqmQ

What should I do the gradient is not applying correctly. Additionally Is there any way I can make all commands as one?
Thank you.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: php image reflection with gradient not working in imagemagick command line

Post by snibgo »

What version IM?

Do all your commands succeed?

Your final command reads out/shadowed.png, but no command creates it.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: php image reflection with gradient not working in imagemagick command line

Post by fmw42 »

convert -size 310x150 -alpha set gradient:rgba\(255,0,255,0.6\)-rgba\(255,255,0,0.50\) out/grad.png
Try

convert -size 310x150 -alpha set gradient:"rgba(255,0,255,0.6)-rgba(255,255,0,0.50)" out/grad.png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: php image reflection with gradient not working in imagemagick command line

Post by fmw42 »

Post Reply