Imagick::setColorspace

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

Imagick::setColorspaceSet colorspace

说明

Imagick::setColorspace ( int $COLORSPACE ) : bool

Sets the global colorspace value for the object. 此方法在Imagick基于ImageMagick 6.5.7以上版本编译时可用。

参数

COLORSPACE

One of the COLORSPACE constants

返回值

成功时返回 TRUE

错误/异常

错误时抛出 ImagickException。

User Contributed Notes

T 28-Dec-2014 09:20
Right now this function doesn't appear to do anything, ref: http://stackoverflow.com/q/10739822/2685496

As mentioned in the answer, modulateImage works fine as a replacement for converting to gray scale.

<?php

$image
= new Imagick("input.jpg");

$image->modulateImage(100, 0, 100);

$image->writeImage("output.jpg");

$image->clear();

?>