chaoscarnage wrote:
I am programmatically creating a string to call using PHP Exec() to combine a bunch of images together sometimes in a specific way.
OK. Then consider about your first simple case.
If you just want to compose n file to background,
Code: Select all
convert background src_1 -compose over -composite tmp_1
convert tmp_1 src_2 -compose over -composite tmp_2
...
convert tmp_n-1 src_n -compose over -composite target
will work of course.
To remove temporary file using correct syntax. If input is 2 file,
Code: Select all
convert
\( background src_1 -compose over -composite \)
src_2
-compose over -composite
target
In this case, you can omit parenthesis. So nth case
Code: Select all
convert
background
src_1
-compose over -composite
src_2
-compose over -composite
[...]
src_n
-compose over -composite
target
chaoscarnage wrote:
However, I need to go a step further and modify a couple of the images before they get added to the overall image.
If you want to do something special for src2, your code would be like the following.
Code: Select all
convert
background
src_1
-compose over -composite
\( [do something special to src_2] \)
-compose over -composite
[...]
src_n
-compose over -composite
target
For example, If special operation is compose from sub2_1 and sub2_2 using dst_over
Code: Select all
convert
background
src_1
-compose over -composite
\( sub2_1 sub2_2 -compose dst_over -composite \)
-compose over -composite
[...]
src_n
-compose over -composite
target