array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'imagick.setimageopacity.php', 1 => 'Imagick::setImageOpacity', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.setimagemattecolor.php', 1 => 'Imagick::setImageMatteColor', ), 'next' => array ( 0 => 'imagick.setimageorientation.php', 1 => 'Imagick::setImageOrientation', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/setimageopacity.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::setImageOpacity — Sets the image opacity level
Esta função tornou-se DEFASADA a partir da Imagick 3.4.4. O uso desta função é fortemente desencorajado.
Sets the image to the specified opacity level. Este método estará disponível se a extensão Imagick tiver sido compilada com a ImageMagick versão 6.3.1 ou superior. This method operates on all channels, which means that for example opacity value of 0.5 will set all transparent areas to partially opaque. To add transparency to areas that are not already transparent use Imagick::evaluateImage()
opacity
The level of transparency: 1.0 is fully opaque and 0.0 is fully transparent.
Retorna true
em caso de sucesso.
Exemplo #1 A Imagick::setImageOpacity() example
An example of using Imagick::setImageOpacity()
<?php
/* Create the object */
$image = new Imagick('source.png');
/* Set the opacity */
$image->setImageOpacity(0.7);
/* output the image */
header('Content-type: image/png');
echo $image;
?>