Skip to content

Instantly share code, notes, and snippets.

@Shaked
Created January 20, 2018 21:00
Show Gist options
  • Save Shaked/a191b70fc12a761892a400cc59ac016c to your computer and use it in GitHub Desktop.
Save Shaked/a191b70fc12a761892a400cc59ac016c to your computer and use it in GitHub Desktop.
PHP Imagick replacement for setImageOpacity
<?php
//https://bugs.php.net/bug.php?id=74160
$img = new \Imagick();
$transparent = new \ImagickPixel('#00000000');
$img->readImage($source);
$img->transparentPaintImage(
$transparent,
0.3,
10,
true
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment