2

I'm trying to use PHP/Imagick api to implement the effect that the convert command (with ImageMagick) does. For convenience, I have simplified my question as this:

The result I want to achieve is this:

convert one.jpg two.jpg three.jpg -compose blend -define compose:args=100,0 -composite result.jpg

While in the PHP/Imagick api, I can only find the Imagick::compositeImage() function that can only do composite one by one, but not three images together. I have tried to do it firstly composite one.jpg with two.jpg, and then use the temporary result to composite with three.jpg. It turns out that the result is not the same with that of the convert command.

So how can I achieve the effect in result.jpg with the PHP/Imagick api?

Thanks. Any idea is appreciated.

taijirobot
  • 143
  • 1
  • 2
  • 8
  • Can you please post your code, using composite the way u did should work, you must be messing with some argument or imagick handle. – kailash19 Aug 26 '13 at 09:44
  • @kailash19 thank you for your comment. I finally found the way by checking out the source code of imagemagick. Mostly are parameter problem. – taijirobot Aug 30 '13 at 21:57
  • 1
    @taijirobot Could you please post the answer to your question? I am having the same problem right now and can't figure it out. – Jens Fischer Sep 11 '13 at 01:08
  • @JensFischer I guess I had a misunderstanding of blending images. In fact I think blending is always a layer by layer operation. You can check out this question: http://stackoverflow.com/questions/5919663/how-does-photoshop-blend-two-images-together. As to the argument settings, there is a `setOption` method. Btw, in my question, the compose argument setting is `100,0`, which seems meaningless because it takes 100% from the source image and 0% from the other. For blending images in Imagemagick, please refer to: http://www.imagemagick.org/Usage/compose/#blend – taijirobot Sep 17 '13 at 21:38

0 Answers0