commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Lucas (JIRA)" <>
Subject [jira] [Commented] (IMAGING-126) TIFF and PNG images should not be bigger than the ones created by java ImageIO
Date Tue, 25 Feb 2014 15:24:21 GMT


Gary Lucas commented on IMAGING-126:

Just found an Adobe Tech Note from 2002 that recommended using 32K rather than 8K for strip
size (Adobe took over the management of the TIFF format in the 90's).   That setting results
in a storage size of about  543 K on disk...  Still bigger than the target 400 K, but better
than 1.04 MB.   I've still got the problem with the black strip on the bottom.

If I set the strip memory size to target 64K, I get an output file size of 400 K, which is
about the same as your target size.   I can increase the strip size further and get further
reductions, though at some point, the output violates some format issue because Microsoft
Windows Photo Viewer complains about an improper TIFF file format.

The other interesting thing I found is that the original author wrote his own LZW compression
code.  Perhaps he wrote the code before LZW compression was part of the standard Java API.
  In any case, the write times for your test image are running about 3.3 seconds on my computer.
 I'm willing to be that if the code were changes to use the standard Java API version of the
compressor, it would speed that up substantially.  So there could be opportunity to make the
package faster for your application in the future.


> TIFF and PNG images should not be bigger than the ones created by java ImageIO
> ------------------------------------------------------------------------------
>                 Key: IMAGING-126
>                 URL:
>             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,
> 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

View raw message