update : 2015.11.03
php.shukuma.com

검색:
 
 
Transforms an image to a new colorspace.

Imagick::transformImageColorspace

(No version information available, might only be in Git)

Imagick::transformImageColorspaceTransforms an image to a new colorspace.

설명

bool Imagick::transformImageColorspace ( int $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.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

Example #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();
}
?>

참고

예제

Example #2 Imagick::transformImageColorspace()

<?php
function transformImageColorspace($imagePath$colorSpace$channel) {
    
$imagick = new \Imagick(realpath($imagePath));
    
$imagick->transformimagecolorspace($colorSpace);
    
$imagick->separateImageChannel($channel);
    
header("Content-Type: image/jpg");
    echo 
$imagick->getImageBlob();
}

?>