Any chance to improve the performace of this "-compose" cmd?
Posted: 2008-06-19T05:06:11-07:00
Hi guys,
I hope you can help me out.
I have a black image (about 500x500px) which I create with
On this image I need to "stamp" dozens of copies one(!) single other image.
The stamp image looks like this:

Right now I run this command in a loop with varying geometry values:
I tried it with a loop for about 60 stamps. Took it 15sec to apply them. 
But I will most likely need to have the chance to stamp up to several hundred instances of stamp_pic.png onto black_canvas.png.
I got a slight improvement by "stamping" it multiple times per command using something like:
But neither do I know how many "-compose" actions are allowed per command nor did it improve the performance seriously in any way.
What would you recommend me to do here?
(this is gonna be part of a small PHP project of mine)
(the "screen" blend mode is quite important btw.)
I hope you can help me out.

I have a black image (about 500x500px) which I create with
Code: Select all
convert -size 500x500 xc:black black_canvas.png
The stamp image looks like this:

Right now I run this command in a loop with varying geometry values:
Code: Select all
convert black_canvas.png stamp_pic.png -compose screen -geometry +123+456 -composite black_canvas.png

But I will most likely need to have the chance to stamp up to several hundred instances of stamp_pic.png onto black_canvas.png.
I got a slight improvement by "stamping" it multiple times per command using something like:
Code: Select all
convert black_canvas.png \
stamp_pic.png -compose screen -geometry +123+456 -composite \
stamp_pic.png -compose screen -geometry +789+123 . . . -composite \
. . . \
black_canvas.png
What would you recommend me to do here?
(this is gonna be part of a small PHP project of mine)
(the "screen" blend mode is quite important btw.)