Page 1 of 1

php image reflection with gradient not working in imagemagick command line

Posted: 2017-05-09T02:16:09-07:00
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.

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

Posted: 2017-05-09T06:12:25-07:00
by snibgo
What version IM?

Do all your commands succeed?

Your final command reads out/shadowed.png, but no command creates it.

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

Posted: 2017-05-09T09:12:17-07:00
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

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

Posted: 2017-05-09T19:11:49-07:00
by fmw42