PHP imagick将图像从CMYK转换为RGB反转图像
我有一张图像被eBay API拒绝,原因如下:PHP imagick将图像从CMYK转换为RGB反转图像,php,rgb,imagick,Php,Rgb,Imagick,我有一张图像被eBay API拒绝,原因如下: <ShortMessage>Source picture uses an unsupported colorspace.</ShortMessage> <LongMessage>Pictures with a CMYK colorspace are not supported; source pictures must use a RGB colorspace compatible with all w
<ShortMessage>Source picture uses an unsupported colorspace.</ShortMessage>
<LongMessage>Pictures with a CMYK colorspace are not supported; source pictures must use a RGB colorspace compatible with all web browsers supported by eBay. Submit pictures created using a camera or scanner set to save images with RGB color.</LongMessage>
它可以转换(现在被易趣接受),但也可以反转图片的颜色。为什么它会这样做?我是否应该使用另一个颜色空间
谢谢。setImageColorSpace方法不适用于现有图像-它仅适用于新图像(例如
$imagick->newPseudoImage(100100,“xc:gray”);
)
transformImageColorSpace方法是用于更改现有图像颜色空间的正确方法
$image= "$img.jpg";
$i = new Imagick($image);
$i->transformImageColorspace(Imagick::COLORSPACE_SRGB);
$i->writeImage($image);
$i->destroy();
工作完美。谢谢帮了大忙!更多信息请点击这里
$image= "$img.jpg";
$i = new Imagick($image);
$i->transformImageColorspace(Imagick::COLORSPACE_SRGB);
$i->writeImage($image);
$i->destroy();