PHP 7.2.0 Release Candidate 4 Released

Imagick::setColorspace

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

Imagick::setColorspaceSet colorspace

说明

bool Imagick::setColorspace ( int $COLORSPACE )

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

参数

COLORSPACE

One of the COLORSPACE constants

返回值

成功时返回 TRUE

错误/异常

错误时抛出 ImagickException。

add a note add a note

User Contributed Notes 1 note

up
1
T
2 years ago
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();

?>
To Top