Created
March 24, 2021 06:37
-
-
Save guoguolong/afe1adac5f55e3cf791e8f659dcb9f88 to your computer and use it in GitHub Desktop.
compound images with Imagick libarary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image_basedir = './'; | |
$dude = new Imagick($image_basedir . 'images/photo.jpg'); | |
$mask = new Imagick($image_basedir . 'images/frame.png'); | |
$dude->setImageMatte(1); | |
$dude->compositeImage($mask, Imagick::COMPOSITE_DSTIN, 0, 0); | |
$dude->writeImage($image_basedir . 'mask.png'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image_basedir = './'; | |
$im = new Imagick($image_basedir . 'images/widget.jpg'); | |
$album = new Imagick($image_basedir . 'images/bg.jpg'); | |
// $im->rotated(....) | |
$album->compositeimage($im, Imagick::COMPOSITE_OVER, 10 ,20); | |
$album->writeImage($image_basedir . 'album.jpg'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment