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