<?php
bool public Imagick::setImageAlphaChannel(int $mode);
?>
AVAILABLE "imagick" CONSTANTS STUDIED IN THIS TUTORIAL 1690 - ImageMagick 6.9.10-6 | ||
ALPHACHANNEL | ||
CONSTANT | VALUE | ABOUT |
imagick::ALPHACHANNEL_ACTIVATE | 1 | ImageMagick version 6.3.8 or higher. |
imagick::ALPHACHANNEL_DEACTIVATE | 4 | ImageMagick version 6.3.8 or higher. |
imagick::ALPHACHANNEL_RESET | 7 | ImageMagick version 6.3.8 or higher. |
imagick::ALPHACHANNEL_SET | 8 | ImageMagick version 6.3.8 or higher. |
imagick::ALPHACHANNEL_UNDEFINED | 0 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_COPY | 3 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_EXTRACT | 5 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_OPAQUE | 6 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_SHAPE | 9 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_TRANSPARENT | 10 | ImageMagick version 6.4.6 or higher. |
imagick::ALPHACHANNEL_BACKGROUND | 2 | ImageMagick version 6.5.3 or higher. |
imagick::ALPHACHANNEL_REMOVE | 12 | ImageMagick version 6.7.8 or higher. |
imagick::ALPHACHANNEL_ASSOCIATE | 13 | ImageMagick version 6.9.0 or higher. |
imagick::ALPHACHANNEL_DISSOCIATE | 14 | ImageMagick version 6.9.0 or higher. |
imagick::ALPHACHANNEL_ON | ImageMagick version 7.0.0 or higher. | |
imagick::ALPHACHANNEL_OFF | ImageMagick version 7.0.0 or higher. | |
imagick::ALPHACHANNEL_DISCRETE | ImageMagick version 7.0.0 or higher. | |
ed48 |
<?php
$str1img = PATH2IMGW . '/results/9new sa.png';
$str1iimg = 'img/results/9new sa.png';
$imagick = new Imagick();
$imagick->newPseudoImage(200, 100, "gradient:red-rgba(25, 255, 0, 0.5)");
$imagick->setImageFormat('png');
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_COPY);
$data = $imagick->getImageBlob();
$im = imagecreatefromstring($data);
imagepng($im, $str1img);
?>
<img src="<?php echo $str1iimg; ?>"
alt="<?php echo $str1iimg; ?>"
title="<?php echo $str1iimg; ?>">
<?php
// Run several times
$str1img = PATH2IMGW . '/results/9new sa2.png';
$str1iimg = 'img/results/9new sa2.png';
$imagick = new Imagick();
$imagick->newPseudoImage(200, 100, "gradient:red-rgba(25, 255, 0, 0.5)");
$imagick->setImageFormat('png');
$imagick->setImageAlphaChannel(Imagick::ALPHACHANNEL_COPY);
$data = $imagick->getImageBlob();
$im = imagecreatefromstring($data);
imagepng($im, $str1img);
?>
<img src="<?php echo $str1iimg; ?>"
alt="<?php echo $str1iimg; ?>"
title="<?php echo $str1iimg; ?>">