mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.01k stars 9.93k forks source link

ICC profiles support for images #2856

Open 13xforever opened 11 years ago

13xforever commented 11 years ago

Right now pdf.js ignores embedded color profiles of any kind.

Here's a test pdf that looks just fine with Windows Reader on Windows 8, but shows no support in PDF.js.

And yes, Firefox does work (same test, but as html: http://www.color.org/version4html.xalter)

13xforever commented 11 years ago

Details: firefox 21.0a2 (2013-02-28) pdf.js version 0.7.256 screenshot: icc_pdf

gigaherz commented 11 years ago

The HTML site shows version 2 support only in here (windows 7 x64, firefox aurora), is this something new to windows 8?

gigaherz commented 11 years ago

SumatraPDF doesn't support those profiles either, so I wonder how important the support really is?

13xforever commented 11 years ago

ICCv4 is disabled by default in Firefox, you have to flip gfx.color_management.enablev4 to True

13xforever commented 11 years ago

I don't know how important it is, but I couldn't find any relevant bug, so I made a new one with links to test cases.

gigaherz commented 11 years ago

Yeah it's okay, better to have a tracking bug. Worst case the devs would close as "won't fix", best case it gives some dev or contributor something to do ;P

SamyCookie commented 6 years ago

I don't know if it works, but if it can help someone to implement ICC profiles, I found this: https://formats.kaitai.io/icc_4/javascript.html It seems to be CC0 license, it may be a start to begin ICC profiles support.

SumatraPeter commented 4 years ago

Frankly it's a bit ridiculous that Firefox's PDF viewer (PDF.js) still lacks support for both v2 and v4 profiles in the year 2020. 😠 👎

nvmnghia commented 4 years ago

Seems that even Chrome doesn't support v4 profile.

zivni commented 1 year ago

Is there any progress on this?

zivni commented 10 months ago

So long, and still no fix?

glennwilton commented 9 months ago

Ive written an ICC engine in Javascript, It can read V2 and V2 color profiles, takes around 40ms to build a 33x33x33 LUT and CMYK>RGB via Uint8ClampedArray is in the order of 20-30 million PIXELS per second, Its not public yet, let me know if anyone is interested in me releasing the code.

CKingX commented 8 months ago

Seems that even Chrome doesn't support v4 profile.

Chrome supports v4 now. Same for Edge and iOS PDF viewer when I tested.

glennwilton commented 8 months ago

I released my Javascript ICC color engine here: https://www.npmjs.com/package/jscolorengine. I don't have time to implement it in PDFJS, but someone else might be able to look into it, however I believe its only halfway as there might be need to implement Type 1 Color Rendering Dictionary, however there is groundwork in my code for handling all of this.

Headcrabed commented 4 months ago

Is this problem actually being worked on?