Imagick如何处理CMYK中的值?
我有通过Photoshop获得的0到100的CMYK颜色,但是我不知道如何将其应用于Imagick。
如何将此颜色代码转换为Imagick可读的颜色代码:C: 52, M: 92, Y:0, K:0
。
$image = new Imagick("a-cmyk-img.jpg");
$fillColor = new \ImagickPixel();
$fillColor->setColor('cmyk(52,95,0,0)');
$draw = new ImagickDraw();
$draw->setFillColor($fillColor);
$textContainer = new Imagick();
$textContainer->newImage(300, 400, new ImagickPixel('transparent'));
$textContainer->setColorspace($image->getImageColorspace());
$textContainer->annotateImage($draw, 0, 0, 0, "Test!\nTest!");
$textContainer->setCompressionQuality(100);
$textContainer->setImageResolution(300, 300);
$image->compositeImage($textContainer, Imagick::COMPOSITE_OVER, 0, 0);