pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4184) [PATCH]: Support simple lossless compression of 16 bit RGB images
Date Wed, 19 Sep 2018 16:39:00 GMT

    [ https://issues.apache.org/jira/browse/PDFBOX-4184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620827#comment-16620827
] 

Tilman Hausherr commented on PDFBOX-4184:
-----------------------------------------

The cmyk test fails, there are many 1-differences like this:

 

expected: <FF070606> but was: <FF070505>;

expected: <FF070607> but was: <FF070507>;

expected: <FF808181> but was: <FF808081>;

expected: <FF070606> but was: <FF070505>;

expected: <FF808181> but was: <FF808081>;

This is not much but I wonder why it works for you. What OS and what Java are you using? I
tested this on W10 with jdk8 latest.

> [PATCH]: Support simple lossless compression of 16 bit RGB images
> -----------------------------------------------------------------
>
>                 Key: PDFBOX-4184
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4184
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Writing
>    Affects Versions: 2.0.9
>            Reporter: Emmeran Seehuber
>            Priority: Minor
>             Fix For: 2.0.12, 3.0.0 PDFBox
>
>         Attachments: 16bit.png, LoadGovdocs.java, fix_profile_use.patch, fix_profile_use3.patch,
fix_profile_use4.patch, images.zip, lossless_predictor_based_imageencoding.patch, lossless_predictor_based_imageencoding_v2.patch,
lossless_predictor_based_imageencoding_v3.patch, lossless_predictor_based_imageencoding_v4.patch,
lossless_predictor_based_imageencoding_v5.patch, lossless_predictor_based_imageencoding_v6.patch,
pdfbox_support_16bit_image_write.patch, png16-arrow-bad-no-smask.pdf, png16-arrow-bad.pdf,
png16-arrow-good-no-mask.pdf, png16-arrow-good.pdf, size_compare.txt
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message