prawnpdf / prawn

Fast, Nimble PDF Writer for Ruby
https://prawnpdf.org
Other
4.67k stars 688 forks source link

Issue with image colors when converting to PDF #1311

Open HAWAWINI opened 1 year ago

HAWAWINI commented 1 year ago

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](https://github.com/prawnpdf/prawn/assets/20285174/18be6126-9781-4f35-bd6f-6499154632a4) Original Image image PDF output Thank you in advance for your help
pointlessone commented 1 year ago

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).