array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'imagick.transformimagecolorspace.php', 1 => 'Imagick::transformImageColorspace', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.transformimage.php', 1 => 'Imagick::transformImage', ), 'next' => array ( 0 => 'imagick.transparentpaintimage.php', 1 => 'Imagick::transparentPaintImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/transformimagecolorspace.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 3)
Imagick::transformImageColorspace — Transforms an image to a new colorspace
Transforms an image to a new colorspace.
colorspace
The colorspace the image should be transformed to, one of the COLORSPACE constants e.g. Imagick::COLORSPACE_CMYK.
Retorna true
em caso de sucesso.
Exemplo #1 Imagick::transformImageColorspace() example
Transforms an image to a new colorspace, and then extracts a single channel so that the individual channel values can be viewed.
<?php
function transformImageColorspace($imagePath, $colorSpace, $channel) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->transformimagecolorspace($colorSpace);
//channel should be one of the channel constants e.g. \Imagick::CHANNEL_BLUE
$imagick->separateImageChannel($channel);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>