Blend mode: Linear-dodge in php

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
gormonn
Posts: 8
Joined: 2014-03-19T03:09:41-07:00
Authentication code: 6789

Blend mode: Linear-dodge in php

Post by gormonn »

Hello!
To composite images i use:

Code: Select all

$canvas->compositeimage($image, Imagick::COMPOSITE_MULTIPLY, 10, 150);
http://php.net/manual/ru/imagick.compositeimage.php

How to use that with blend mode "Linear-dodge"?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

Moved to Imagick forum
gormonn
Posts: 8
Joined: 2014-03-19T03:09:41-07:00
Authentication code: 6789

Re: Blend mode: Linear-dodge in php

Post by gormonn »

sorry, misunderstood
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

Apparently, from http://us3.php.net/manual/en/imagick.co ... ompositeop, they did not implement linear_dodge. Imagick is not well maintained and does not have all the options in Imagemagick. You may have to use PHP exec() to do that.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

gormonn wrote:sorry, misunderstood
This is the specific forum dedicated to Imagick
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

The closest I see is colordodge. You could try that. Otherwise, use PHP exec() with the command line version of the code you want to implement.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

According to http://www.imagemagick.org/Usage/compose/#lineardodge, it is the same as -compose plus, except for partially transparent pixels.
gormonn
Posts: 8
Joined: 2014-03-19T03:09:41-07:00
Authentication code: 6789

Re: Blend mode: Linear-dodge in php

Post by gormonn »

Hmm... okay... but imageck haven't constant with that blend mode:
http://php.net/manual/ru/imagick.constants.php

That is why I asked a question there.
I do not understand how to write the correct command.
I tried to understand anything from the documentation, but did not understand, and therefore do nothing at random to failed:

Code: Select all

$cmd = convert '.$result.' img/ach/mozg4.png -compose linear-dodge -define compose:args=100,0 -composite img.png';
exec($cmd);
gormonn
Posts: 8
Joined: 2014-03-19T03:09:41-07:00
Authentication code: 6789

Re: Blend mode: Linear-dodge in php

Post by gormonn »

fmw42 wrote:According to http://www.imagemagick.org/Usage/compose/#lineardodge, it is the same as -compose plus, except for partially transparent pixels.
Hmm... ok, Thank you! i'l try it!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blend mode: Linear-dodge in php

Post by fmw42 »

Yes, that is correct. Imagick does NOT have that mode. So you have two choices.

1) try using COMPOSITE_PLUS
2) use PHP exec()

-define compose:args=100,0
That will choose one or the other image. So it will do nothing useful. You would have to use some mix, such as 50,50.
gormonn
Posts: 8
Joined: 2014-03-19T03:09:41-07:00
Authentication code: 6789

Re: Blend mode: Linear-dodge in php

Post by gormonn »

COMPOSITE_PLUS helped!
Thank you so much, fmw42! Or how you real name? Fred?
You saved me from sleepless nights!
Happiness and success to you!
Post Reply