pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

PNG image support

Open ismyrnow opened this issue 8 years ago • 3 comments

I recognize that the library doesn't currently support PNG images.

I looked into the effort involved, and created a fork with an initial attempt at it. Parsing image dimensions was easy, but dealing with color profiles and transparency is much more work. I had it working at one point, but don't have a decent example of it yet.

Any advice on how to move forward, or if this feature is planned?

ismyrnow avatar Sep 18 '15 16:09 ismyrnow

Hi @ismyrnow, thanks for having a look into a PNG implementation. I definitely plan on adding it, but because of the effort required and the fact that I am currently mostly fine with embedding existing PDFs as images, I've not yet started in doing so. Anyway, I'll try to have a look at you initial attempt in the next couple of days; maybe I can help or can use it as a starting point :-)

rkusa avatar Sep 19 '15 19:09 rkusa

I seems that PNGs need to be split into image data (IDAT), palette (PLTE) and a color profile (iCCP) object. That is, embedding PNGs is not as simple as embedding JPEGs. For parsing PNGs, I think an external library would make totally sense. However, I was not yet able to find one that I would be happy with (e.g. not browser compatible or no 16bit png support ...). I am not yet sure how to tackle this, but will keep thinking about it.

rkusa avatar Sep 27 '15 12:09 rkusa

Really looking forward to PNG support 👍

knownasilya avatar Apr 19 '16 20:04 knownasilya