Page 1 of 1

combining two convert commands into one

Posted: 2016-05-14T12:57:08-07:00
by kannaiah
Hi,

I'm trying to use merge few images, I'm able to get the image I want with two commands but unable to do it in a single command.

Code: Select all

convert background.png -level 0%,100%,0.6 -blur 2x8 fore_01.png -gravity center -composite temp.png
convert temp.png fore_02.png -geometry +715+313 -composite fore_03.png -geometry +566+575 -composite result.png
Is there a way to get the same result in one command.

I tried to follow few tutorials but unble get upto speed. If there is a simple nice tutorial please let me know.

Thank you.

Re: combining two convert commands into one

Posted: 2016-05-14T13:29:45-07:00
by fmw42
What version of Imagemagick and what platform? Please always provide that information.

Reset your -gravity before the next composite, unless your geometry coordinates are center relative and not upper left relative. I have done it here twice, thought only one time is really needed.

Unix syntax:

Code: Select all

convert \( background.png -level 0%,100%,0.6 -blur 2x8 \) \
fore_01.png -gravity center -composite \
fore_02.png -gravity northwest -geometry +715+313 -composite \
fore_03.png -gravity northwest -geometry +566+575 -composite result.png
Windows syntax:

Code: Select all

convert ( background.png -level 0%,100%,0.6 -blur 2x8 ) ^
fore_01.png -gravity center -composite ^
fore_02.png -gravity northwest -geometry +715+313 -composite ^
fore_03.png -gravity northwest -geometry +566+575 -composite result.png

Re: combining two convert commands into one

Posted: 2016-05-15T02:41:17-07:00
by kannaiah
Thank you very much.
It worked.

will remember to put all the details next time.