• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • Imagick::setColorspace()

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

    Set 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。

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