PHP 8.3.0 RC 6 available for testing

Gmagick::setimagecolorspace

(PECL gmagick >= Unknown)

Gmagick::setimagecolorspaceSets the image colorspace

说明

public Gmagick::setimagecolorspace(int $colorspace): Gmagick

Sets the image colorspace.

参数

colorspace

One of the Colorspace constant (Gmagick::COLORSPACE_*).

返回值

The Gmagick object.

错误/异常

错误时抛出 GmagickException

add a note

User Contributed Notes 1 note

up
0
MPLong
13 years ago
Convert CMYK to RGB:

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