Is there a PHP Imagick equivalent for -quantize transparent
???
-quantize transparent usage example note: seach for '-quantize transparent' within page
Quantize is supported by PHP's Imagick extension; however, little documentation has been authored. Luckily, the example from "Color Quantization and Transparency" is straightforward.
convert alpha_gradient.png -quantize transparent \
+dither -colors 15 alpha_colors_15qt.png
From this example, we can determine the 5 arguments needed by Imagick::quantizeImage()
.
<?php
$wand = new Imagick("alpha_gradient.png");
$wand->quantizeImage(15,Imagick::COLORSPACE_TRANSPARENT,0,false,false);
$wand->writeImage("alpha_colors_15qt.png");