[
https://issues.apache.org/jira/browse/PDFBOX-2681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jon Wu updated PDFBOX-2681:
---------------------------
Attachment: gradient-test-photo-rgb.pdf
gradient-test-photo-rgb-illustrator.jpg
gradient-test-photo-rgb-pdfbox.jpg
John: Wow thanks for the insight about color profiles. That makes a lot of
sense and it's good to know why the color is different and even better to know
that I could make the colors match by using the right profile. Looks like I
should be able to download it separately and use it internally since it's
available "as a free download for graphics professionals to use across their
workflows."
Tilman: Adding samples of the PDF saved as RGB from Illustrator as an example
where PDFBox is basically perfect. The RGB PDF does have ShadingType in it just
like the CMYK PDF that's causing the problem.
Accurate gradient rendering for files like the CMYK sample here have been a
problem for almost every Java PDF library I've tried except a rare few, when
using Adobe's PDF rendering as a benchmark. Now that I'm looking closer and
comparing against pdf.js, OS X Preview.app, and Chrome, this rendering looks
pretty close to all of those libraries and Adobe's version is really in a
league of its own. That's definitely pretty solid.
I noticed that the colors in these other libraries are very similar (maybe
identical?) to the ones from PDFBox. Could the difference in gradient just be
the color conversion? I'm not sure how the gradient is rendered but would it be
different in CMYK vs RGB and if that was an issue could you potentially convert
the colors to RGB first and then apply gradient logic?
I've been looking for an open source way to rasterize PDF files and PDFBox
2.0.0 is coming really close to being accurate. The reason I'm looking into all
the details is that I'm trying to create a raster as a print preview so the
colors are important. The only huge blocker that I know of is PDFBOX-1206 and
once that's fixed I'll do some more extensive tests across the board.
> Colors inaccurate rastered CMYK source w/ gradient + photo
> ----------------------------------------------------------
>
> Key: PDFBOX-2681
> URL: https://issues.apache.org/jira/browse/PDFBOX-2681
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.0
> Environment: Tested on OS X 10.10, Java 1.6 / 1.8
> Reporter: Jon Wu
> Attachments: gradient-test-illustrator.jpg, gradient-test-pdfbox.jpg,
> gradient-test-photo-illustrator.jpg, gradient-test-photo-pdfbox.jpg,
> gradient-test-photo-rgb-illustrator.jpg, gradient-test-photo-rgb-pdfbox.jpg,
> gradient-test-photo-rgb.pdf, gradient-test-photo.pdf, gradient-test.pdf
>
>
> In the attached gradient-test-photo.pdf, there's a photo with a gradient on
> top of it. The colors in the gradient are CMYK. When rasterizing this test
> file with PDFBox 2.0.0 SNAPSHOT 20150209, the resulting image's gradient is
> different from the original and the colors of the photo under the gradient
> look significantly different vs the display in Adobe tools like Illustrator
> or other compliant PDF readers.
> Issues:
> - Color hue is wrong. Is this a CMYK to RGB issue?
> - Opacity of gradient is wrong and much different. The jpg from Illustrator
> shows much more of the photo without a gradient over it.
> Without a photo, there's still a difference, but it's much harder to see.
> Example in gradient-test.pdf where the same gradient is drawn over a grey
> rectangle.
> If I convert the PDF to RGB in Illustrator first and rasterize the RGB PDF
> with PDFBox, the result is nearly identical between Illustrator and PDFBox so
> this seems like a CMYK conversion issue in both the general color conversion
> and maybe how the gradient is calculated.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]