php函数imagick生成灰度差异图片
时间:2021-07-01 10:21:17
帮助过:24人阅读
$image = new Imagick('cyclops.png'); $clone = $image->clone(); - $clone = $image->fximage('p{0,0}');
- $image->compositeImage($clone,imagick::COMPOSITE_DIFFERENCE,0,0);
- $image->modulateImage(100, 0 , 0);
- header( 'Content-Type: image/{$image->getImageFormat()}' );
- echo $image->getImageBlob( );
//$image->writeImage('difference.png'); - $image->clear();
- $image->destroy();
- ?>
源图片:
效果图(生成的灰度差异图片):
|