-
-
$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();
- ?>
-
复制代码
源图片:
效果图(生成的灰度差异图片):
|