C
C
ChemAli2014-06-23 12:14:25
PHP
ChemAli, 2014-06-23 12:14:25

PHP+GD: How to do multiply blending when overlaying images?

There are two pictures: a gray base and a logo with a white background.
97c928a5a42d4e709516e1467a2fd770.pngfb1820a5269648c2b9db280b4c619aff.jpeg
The task is to overlay the logo on top of the gray base so that they merge. In the graphics editor, everything seems to be simple: two layers, where Blending mode: multiply is set for the top one with the logo and everything is ready:
85b14a55acbb4af9b2f4c231b73d4a62.png
How to do this in PHP using the GD library?
The only thing I dug into myself is the option of overlaying a semi-transparent top image on top of the base:

$image_1 = imagecreatefrompng('base.png');
    imagealphablending($image_1, true);
    imagesavealpha($image_1, true);
    imagecopymerge($image_1, $iage_2, 0, 0, 0, 0, 100, 100, 50);

05f51c95fa0a4c16b5790bae199ecc8f.jpeg
But that's not it at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philip, 2014-06-23
@shcherbanich

I understand that you want to use this picture as a watermark? www.phpclasses.org/search.html?words=watermark&x=0...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question