Audio stickers generate image summary imagick

Source: Internet
Author: User

2014-08-24
All of them are based on previous programs. However, in last August, you can use imagick to generate a CMYK image normally, but today it cannot.
After all the test methods and ideas, the solution is as follows.

The problem mainly occurs in that the generated QR code is in RGB format and needs to be converted to CMYK, and then the image is synthesized with the CMYK module.


First, the previously generated QR code is in PNG format and the bit depth is 8. After analysis, the generated QR code is changed to JPG format with a bit depth of 24.

Second, convert the QR code to the CMYK format before merging with the template. Then merge with the template.

 

Private function rgbtocmyk ($ source, $ save_file, $ icc_cmyk, $ icc_rgb) {$ img_object = new imagick ($ source); if ($ img_object-> getimagecolorspace () = 1 or $ img_object-> getimagecolorspace () = 13) {$ profiles = $ img_object-> getimageprofiles ('*', false ); $ has_icc_profile = (array_search ('icc ', $ profiles )! = False); if ($ has_icc_profile = false) {// $ icc_cmyk = file_get_contents ('. /public/img/adobergb1998.icc '); $ img_object-> profileimage ('icc', $ icc_cmyk); unset ($ icc_cmyk);} // $ icc_rgb = file_get_contents ('. /public/img/uswebuncoated. ICC '); $ img_object-> profileimage ('icc', $ icc_rgb); unset ($ icc_rgb);} $ image_data = $ img_object-> getimagegeometry (); $ img_object-> setimagecolorspace (12); $ img_object-> setimageformat ('jpeg '); $ img_object-> writeimage ($ save_file); $ img_object-> clear (); $ img_object-> destroy (); return $ save_file ;}

Audio stickers generate image summary imagick

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.