Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PDF converted from an icc-profiled raster images should use `/ColorSpace /ICCBased` #417
Sorry for the wall of text. The problem is simple. I think the solution isn't that difficult either. The explanation is what needs elaboration.
In order for PDFs produced by ImageMagick from icc-profiled raster images to be correctly displayed in Adobe Reader, I need ImageMagick to instead of doing the following:
to be doing the following:
Would it be possible to make PDFs, converted from icc-profiled raster images, be created with the image XObject that uses
Currently ImageMagick includes the icc profile in the XObject's binary data. This icc profile is not interpreted by Adobe Reader (and many other apps), making the image be rendered with incorrect colours. I propose, that ImageMagick continue doing what it's doing (there is a very good reason for it), but additionally ImageMagick should also use the
You'll also need:
Replace it with this
According to the PDF Reference link, I say it's best to use PDF version 1.7 for the
If ImageMagick is able to extract the icc profile from the input raster file (i.e. step 4 from the test case succeeds), then the output pdf should be produced in version 1.7.
This change would make one more thing to JustWorkTM in ImageMagick. There are a couple of links in the google showing, that some people stumble upon this problem. I am one of them.
That's great news! Thanks.
I looked at the diff and saw, that PDF version 1.7 isn't being chosen, when
Also, I saw, that in the ChangeLog file you reference this github issue. I was planning on removing the test file (mentioned in the test case) from my Dropbox. Is it fine for me to do that, or would you like me to upload it somewhere else?
It works fantastic now. Thanks again @dlemstra .
One thing though. If you are able to stream the icc profile as a binary into the output pdf, instead of hex-encoding it, it would produce a smaller pdf. In this case you just need to drop the
Thanks again. Can I close this ticket now or do you have a different process for closing tickets?
pushed a commit
Apr 3, 2017
pushed a commit
Apr 3, 2017
I don't see the fix regarding the ICC profile backported to 6.9.8-4 yet? Did that get overlooked or will that be on -5? https://github.com/ImageMagick/ImageMagick/blob/6.9.8-4/coders/pdf.c#L2188
Right, the fix for this got in - but I'm curious if the additional fix in this comment got covered? #417 (comment)
When I look at ln 2188 in the 6.x branch I'm seeing no slashes and running into a problem that looks identical to the bug he reported. Or am I chasing a red herring and the slashes described there weren't the issue?
referenced this issue
May 3, 2017
To all people getting here from google:
Sorry for the inconvenience caused and thanks for your reports.