This SO question and answer might help clarify why transformImageColorspace is useful: http://stackoverflow.com/questions/29296779/convert-pdf-with-transparency-and-cmyk-to-jpg
Also, there's a Github issue here that explains the difference between transformImageColorspace and setImageColorspace: https://github.com/rmagick/rmagick/pull/75Imagick::transformImageColorspace
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Imagick::transformImageColorspace
Референца за `imagick.transformimagecolorspace.php` со подобрена типографија и навигација.
Imagick::transformImageColorspace
(PECL imagick 3)
Imagick::transformImageColorspace — Transforms an image to a new colorspace
= NULL
Transforms an image to a new colorspace.
Параметри
colorspace-
The colorspace the image should be transformed to, one of the COLORSPACE константи e.g. Imagick::COLORSPACE_CMYK.
Вратени вредности
Патеката до PHP скриптата што треба да се провери. true на успешен исход.
Примери
Пример #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();
}
?>Види Исто така
- Imagick::setColorSpace() - Ја поставува стандардната боја на позадината на објектот