php - Convert imagemagick ColorDodge function to imagick -


i'm trying understand how apply filter on 2 images using php imagemagick library:

convert 1.jpg \( -size 2816x1584 tile:2.jpg  \) -compose colordodge -composite out.jpg 

how can using imagemagick php extension without using exec / system? http://php.net/manual/en/book.imagick.php

note command-line version little clumsy requires hard-code image size. think preferable clone original image (so clone same size) , fill clone pattern, rather explicitly stating size, creating canvas , filling it:

convert 1.jpg \( +clone  -fill pattern:checkerboard -draw "color 0,0 reset" \) -compose colordodge -composite result.png 

in php, can this, using 1.jpg

enter image description here

and checkerboard 2.jpg

enter image description here

#!/usr/local/bin/php -f <?php     $img1 = new imagick("1.jpg");      $img2 = clone $img1;     $texture = new imagick("2.jpg");     $img3 = $img2->textureimage($texture);     $img1->compositeimage($img3, imagick::composite_colordodge, 0, 0);     $img1->writeimage('result.jpg'); ?> 

enter image description here


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -