Page 1 of 1

Usage Example - Not working as expected

Posted: 2016-06-24T04:47:19-07:00
by agriz

Code: Select all

convert /( tile_aqua.jpg -resize 200% /) /( tile_water.jpg -gravity center /) /( moon_mask.gif -gravity center /) -composite output.png
I expected the moon to be in the center.
But it is in the top right corner and the moon is not properly visible too.

Code: Select all

convert /( tile_aqua.jpg -resize 200% /) /( tile_water.jpg  /) /( moon_mask.gif /) -composite output.png
However, this is working good.

Re: Usage Example - Not working as expected

Posted: 2016-06-24T09:16:25-07:00
by fmw42
First your slashes / need to be \. Next, the -gravity and -composite needs to be applied separately, unless the images are all the same size.

Try this

Code: Select all

convert \
\( tile_aqua.jpg -resize 200% \) \
\( tile_water.jpg moon_mask.gif -gravity center -alpha off -compose copy_opacity -composite \) \
-gravity center -compose over -composite output.png

Re: Usage Example - Not working as expected

Posted: 2016-06-24T09:21:28-07:00
by agriz
Thank you

Re: Usage Example - Not working as expected

Posted: 2016-06-24T22:41:19-07:00
by agriz

Code: Select all

convert image.png \( -clone 0 rose.png -compose Over -composite  \) \
\(  shape.png \) -delete 0 -alpha off -compose copy_opacity -composite \
image.png +swap -gravity center -compose Over -composite output.png
i used the image.png two times. I am not able to use the clone because i have to delete it while applying shape.png
Is it okay to call the same image multiple times? or should i clone it? If i have to clone, how can i do this coding?

Re: Usage Example - Not working as expected

Posted: 2016-06-24T23:58:45-07:00
by snibgo
Why not write it to an "mpr:"?

Re: Usage Example - Not working as expected

Posted: 2016-06-25T00:52:17-07:00
by agriz
Thank you sir. I have to read about it. I will try it and tell you.
Thanks for the advice

Re: Usage Example - Not working as expected

Posted: 2016-06-25T03:23:51-07:00
by agriz
It's working and what is the difference between clone and mpr which one should i use?

Re: Usage Example - Not working as expected

Posted: 2016-06-25T04:20:18-07:00
by snibgo
Clone and mpr are two different ways of doing similar things, of using images in memory.

A clone can only use an image that is in the immediately outer list. You can't write a clone; you can only read a clone.

By contrast, an mpr has to be explicitly written before it can be used. Once it is written, it can be used anywhere after that in the same "convert" statement.

Re: Usage Example - Not working as expected

Posted: 2016-06-25T04:58:22-07:00
by agriz
Are both of them using same memory?
You said we need to write an MPR. So will it use much memory than clone?

Re: Usage Example - Not working as expected

Posted: 2016-06-25T06:27:32-07:00
by snibgo
Using +clone or -clone to read a clone just creates pointers to the images.

Using +write mpr:ABC or -write mpr:ABC to write images just creates pointers.

Using mpr:ABC to read mpr just creates pointers.