prawn icon indicating copy to clipboard operation
prawn copied to clipboard

Issue with image colors when converting to PDF

Open HAWAWINI opened this issue 2 years ago • 1 comments

Discussed in https://github.com/prawnpdf/prawn/discussions/1310

Originally posted by HAWAWINI September 11, 2023 Hi everyone,

I have an issue with some images when putting an image from Active Storage to Prawn PDF. Apparently the colors are different and as i'm generating PDF for an ART gallery, they are not happy with the results. Here is an example of the problem :

image Original Image

image PDF output

Thank you in advance for your help

HAWAWINI avatar Sep 11 '23 09:09 HAWAWINI

My guess would be the color profile is ignored. Unfortunately, Prawn currently doesn't support color profiles (either for images or for the whole document) and as far as I can tell, there's no workaround. You'd have to either extend JPG/PNG image support to add color profile support, or dive deep into PDF spec to manually add color profile to you documents (hint: there are PRs that try to add document color profile support, search for PDF/A).

pointlessone avatar Sep 11 '23 09:09 pointlessone