Imagick cmky to RGB cmky too RGB

Source: Internet
Author: User

A problem was found during project creation. When imagick is used to process images, it seems that CMYK cannot be processed ..

The thumbnail format is CMYK, but ie cannot be accessed.

Now, you can convert CMYK to GBK code and take notes.

... The previous section is omitted... Save the image as follows:

If ($ im-> getimagecolorspace () = imagick: colorspace_cmyk ){
$ Profiles = $ im-> getimageprofiles ('*', false );
$ Has_icc_profile = (array_search ('icc ', $ profiles )! = False );
If ($ has_icc_profile = false ){
$ Icc_cmyk = file_get_contents ('uswebuncoated. ICC ');
$ Im-> profileimage ('icc ', $ icc_cmyk );
Unset ($ icc_cmyk );
}
$ Icc_rgb = file_get_contents ('adobergb1998. icc ');
$ Im-> profileimage ('icc ', $ icc_rgb );
Unset ($ icc_rgb );
}

$ Im-> writeimage ($ rgb_img );

You can download the provided ICC file:

CMK: http://www.mattbeals.com/icc/profiles/cmyk/USWebUncoated.icc.zip

RGB:Http://www.mattbeals.com/icc/profiles/rgb/AdobeRGB1998.icc.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.