Andrew Murray
Andrew Murray
Could you share the code that you're running to get that output from pdf.js?
Pillow uses [JPXDecode when saving RGBA PDFs](https://github.com/python-pillow/Pillow/blob/d879f397112d1cb50af7d27f16eaf2c7bb221043/src/PIL/PdfImagePlugin.py#L115-L116). Two issues have been opened with pdf.js about rendering from this filter - https://github.com/mozilla/pdf.js/issues/16782 and https://github.com/mozilla/pdf.js/issues/17416 - so I don't think this is...
You can see on page 31 of https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf that JPEG2000 is used in the JPXDecode filter. JPEG2000 is naturally supported in a way that PNGs are [not](https://stackoverflow.com/questions/14659783/insert-png-images-in-pdf-using-flatedecode#comment20489022_14659783). It does appear...
I would prefer Pillow just implement the SMask solution itself rather than add an external dependency. I've created #8097. See what you think.
The PDF.js issue has now been resolved! https://github.com/mozilla/pdf.js/issues/16782 It will still require another release of PDF.js, and then a release of Firefox to include that, but it is a positive...
poppler being used in [Evince](https://en.wikipedia.org/wiki/Evince), and so is effectively the other software that you reported in the original comment. I'm not sold on the idea that if a viewer has...
Testing with the latest version of Firefox (129.0.2), it is now rendering the PDF correctly - so the PDF.js fix has made it through.
> I feel like image transparency should generally be handled via SMasks instead of encoding to JP2 The practical downside to this is that #8097 increases the PDF size of...
> The practical downside to this is that https://github.com/python-pillow/Pillow/pull/8097 increases the PDF size of this image's issue from 15,721 bytes to 26,604 bytes. > > providing file sizes without specifying...
> That said, if you don't mind the somewhat uncommon JPEG2000, why not use it for L/RGB/CMYK, too? That might be more consistent. I tried this with ```diff diff --git...