PHP imagick converting image from CMYK to RGB inverts image -
i have image being rejected ebay api because of this:
<shortmessage>source picture uses unsupported colorspace.</shortmessage> <longmessage>pictures cmyk colorspace not supported; source pictures must use rgb colorspace compatible web browsers supported ebay. submit pictures created using camera or scanner set save images rgb color.</longmessage>
well, had no idea cmyk nor sure how tell. used following code attempt convert:
$image= "$img.jpg"; $i = new imagick($image); $i->setimagecolorspace(imagick::colorspace_srgb); $i->writeimage($image); $i->destroy();
it converts (and accepted ebay), inverts colors of picture. why , there colorspace
should using?
thanks.
the setimagecolorspace method not meant used existing images - it's new images (e.g. $imagick->newpseudoimage(100, 100, "xc:gray");
)
the transformimagecolorspace method right 1 use changing existing images colorspace.
$image= "$img.jpg"; $i = new imagick($image); $i->transformimagecolorspace(imagick::colorspace_srgb); $i->writeimage($image); $i->destroy();
Comments
Post a Comment