Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.9
-
None
-
Patch
Description
The attached patch add support to write 16 bit per component images correctly. I've integrated a test for this here: https://github.com/rototor/pdfbox-graphics2d/commit/8bf089cb74945bd4f0f15054754f51dd5b361fe9
It only supports 16-Bit TYPE_CUSTOM with DataType == USHORT images - but this is what you usually get when you read a 16 bit PNG file.
This would also fix https://github.com/danfickle/openhtmltopdf/issues/173.
The patch is against 2.0.9, but should apply to 3.0.0 too.
There is still some room for improvements when writing lossless images, as the images are currently not efficiently encoded. I.e. you could use PNG encodings to get a better compression. (By adding a COSName.DECODE_PARMS with a COSName.PREDICTOR == 15 and encoding the images as PNG). But this is something for a later patch. It would also need another API, as there is a tradeoff speed vs compression ratio.
Attachments
Attachments
Issue Links
- breaks
-
PDFBOX-4607 Transparent 16 bit image doesn't display in Adobe Reader
- Closed