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

Gary Lucas commented on IMAGING-126:
------------------------------------

I checked the TIFF spec and found where the original author of the code came up 
with the value 64000.  In the TIFF 6.0 Specification, Final - June 3, 1992, 
Section 13 describing the LZW Compression, there is the following statement

"We strongly recommend that RowsPerStrip be chosen such that each strip 
contains about 8K bytes before compression. We want to keep the strips small 
enough so that the compressed and uncompressed versions of the strip can be 
kept entirely in memory, even on small machines" (p. 58).    

Of course, this recommendation made a lot more sense for the computers in use 
in 1992 than it does today.  So I think we can increase that value in the 
code...   Given that other TIFF writing implementations (such as the one you 
used to produce your test image) attain better compression ratios, it appears 
that other implementations make a similar choice.   But we're going to have to 
be careful not to change the code so that TIFF images we create become 
incompatible with other viewers.



> TIFF and PNG images should not be bigger than the ones created by java ImageIO
> ------------------------------------------------------------------------------
>
>                 Key: IMAGING-126
>                 URL: https://issues.apache.org/jira/browse/IMAGING-126
>             Project: Commons Imaging
>          Issue Type: Improvement
>          Components: Format: PNG, Format: TIFF
>    Affects Versions: 1.0
>         Environment: W7
>            Reporter: Tilman Hausherr
>            Priority: Minor
>         Attachments: pdfbox-1870-devicen3-01.png, 
> pdfbox-1870-devicen3-01.tif, pdfbox-1870-devicen3.pdf-1.png, 
> pdfbox-1870-devicen3.pdf-1.tif
>
>
> I tried to use Apache Imaging for the PDFBOX project (PDFBOX-1734) because of 
> problems with setting the tiff resolution in java imageio.
> While the code is pretty nice, I found that the generated images are 
> sometimes much bigger in size than the ones generated by java imageio.
> Example:
> pdfbox-1870-devicen3-01.png 50 KB (imageio)
> pdfbox-1870-devicen3.pdf-1.png 70 KB (imaging)
> pdfbox-1870-devicen3-01.tif 401 KB (imageio)
> pdfbox-1870-devicen3.pdf-1.tif 1063 KB (imaging)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to