Re: convert CMYK image to SRGB
James Bardin <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <CAB4dVTHdPRcJy-fUnBw6eusfzfzeb21YeDBrSdfRBxa9PbyOfA@mail.gmail.com> |
On Sat, Aug 1, 2015 at 10:31 AM, Bob Friesenhahn < [email protected]> wrote: > The core function which does the work is ProfileImage(). If this function > is used when the image has no attached profile, then the new profile is > simply attached to the image (similar to SetImageProfile()). If this > function is used when the image already has an attached profile, then a CMS > transform is performed using the two profiles. > > The ProfileImage() function expects that the profile is provided in memory > rather than a file. The utility function FileToBlob() can be used to read > a file into a memory buffer although for this purpose ReadImage() is used > by the command-line code to read the profile since then it can be read by > the ICC/ICM reader, or retrieved from a JPEG file or other formats > supporting an attached ICM profile. > Ho Bob, OK, this is what I thought. I'm already using this to normalize all images to the sRGB profile, but I can't get some CMYK images into RGB format. After more testing, it seems my test images were confounding the problem. Some other CMYK jpegs do convert nicely. After ProfileImage completes on these problem images, the img.colorspace is still CMYKColorspace, and there appears to have been no CMS transform. Also, ProfileImage returns 1, and there's no exception in Image.exception. I tested with a CMYK image with the profile stripped out, and I get the same behavior, so I think I'll have to put in a manual colorpsace transform in there anyway to catch the case of a cmyk image without a profile. ... after further testing, I'm finding that it may only be some (most?) YCCK images that are failing (GM only identifies these as CMYK). The following image won't convert: http://sourceforge.net/p/libjpeg-turbo/patches/_discuss/thread/e9a20d03/acc4/attachment/image_ycck.jpeg But it's not *all* YCCK images, since I found one that does convert: https://issues.apache.org/jira/secure/attachment/12538847/test-YCCK.jpg Thanks! ------------------------------------------------------------------------------ _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help