文字

Gmagick::setimagecolorspace

(PECL gmagick >= Unknown)

Gmagick::setimagecolorspaceSets the image colorspace

说明

public Gmagick Gmagick::setimagecolorspace ( int $colorspace )

Sets the image colorspace.

参数

colorspace

The image colorspace: UndefinedColorspace, RGBColorspace, GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, HSLColorspace, or HWBColorspace.

返回值

The Gmagick object on success

错误/异常

错误时抛出 GmagickException

用户评论:

[#1] MPLong [2010-06-28 11:24:35]

Convert CMYK to RGB:

<?php
$cs 
$im->getimagecolorspace();
if (
$cs == Gmagick::COLORSPACE_CMYK
{
     
$im->setImageColorspace(Gmagick::COLORSPACE_SRGB);
}
?>

上一篇: 下一篇: