Home > Backend Development > PHP Tutorial > PHP function imagick generates grayscale difference pictures

PHP function imagick generates grayscale difference pictures

WBOY
Release: 2016-07-25 08:51:35
Original
1864 people have browsed it
  1. $image = new Imagick('cyclops.png');

  2. $clone = $image->clone();

  3. $clone = $image->fximage('p{0,0}');
  4. $image->compositeImage($clone,imagick::COMPOSITE_DIFFERENCE,0,0);
  5. $image->modulateImage( 100, 0, 0);
  6. header( 'Content-Type: image/{$image->getImageFormat()}' );
  7. echo $image->getImageBlob( );
  8. writeImage('difference.png');

  9. $image->clear();
  10. $image->destroy();
  11. ?>
Copy the code

Source image: PHP function imagick generates grayscale difference pictures

Rendering (generated grayscale difference picture): PHP function imagick generates grayscale difference pictures



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template