commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Lucas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMAGING-141) BufferedImage from TIFF is always 24 or 32 bpp
Date Thu, 08 Jan 2015 14:48:34 GMT

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

Gary Lucas commented on IMAGING-141:
------------------------------------


The good news is that I ran a bunch of tests on the data format and I do not believe that
there are any serious performance issues related to the 1-bit images (at least under Windows).
  

To make the transition to supporting other than 24-bit images, the ImageBuilder would have
to be modified to present a new interface for indexed color models (one-bit images are a special
case of the indexed color model concept).  A side benefit of this is that much of the code
that deals with indexed color models could be made cleaner and more efficient.  For example,
IcnsImageParser.java has a huge amount of potential for improved efficiency.  One the other
hand, every single one of them is an individual coding effort.  Since all of us on the project
are volunteers, and all of us have constraints on the amount of time we can put into coding,
we have to pick and choose the areas we work on based on people who have real needs (does
anyone actually use ICNS formatted images?).  So I think there needs to be some discussion
of which of the many formats TIFF files support are the priority implementations before we
move forward on this one.

Here's the output from a version of ApacheImagingSpeedAndMemory.java (from our examples space)
which was modified to perform a bunch of image building and copying operations.  The timing
for the operations is pretty much the same whether it processed one-bit or 24-bit images.
 The memory used is much, much smaller.
{code}
Building 10 images plus one master
Image size is 8192 by 8192
Estimated memory for 11 images
   1-bit model: 88.0 mb
  24-bit model: 2112.0 mb
  32-bit model: 2816.0 mb

One-Bit Test ----------------------------------
 time to copy images   --         memory
 time ms      avg ms   --    used mb   total mb
 2480.554     0.000    --     88.834   204.063 
 2400.327     0.000    --     88.697   293.000 
 2409.043  2409.043    --     88.685   297.625 
 2424.185  2416.614    --     88.696   354.063 
 2385.189  2406.139    --     88.596   354.063 
 2403.208  2405.406    --     88.530   354.063 
 2399.188  2404.162    --     88.486   354.063 
 2440.449  2410.210    --     88.456   354.063 
 2404.985  2409.464    --     88.437   354.063 
 2487.661  2419.238    --     88.424   354.063

32-bit images  --------------------------------------

 time to copy images   --         memory
 time ms      avg ms   --    used mb   total mb
 3585.059     0.000    --   3072.638  3194.625 
 2531.779     0.000    --   3074.950  3194.625 
 2343.458  2343.458    --   3073.035  3194.625 
 2362.161  2352.809    --   3073.036  3194.625 
 2318.019  2341.213    --   3073.036  3194.625 
 2296.094  2329.933    --   3073.036  3194.625 
 2325.195  2328.985    --   3073.036  3194.625 
 2313.236  2326.361    --   3073.036  3194.625 
 2307.116  2323.611    --   3073.036  3194.625 
 2327.644  2324.115    --   3073.036  3194.625 
{code}

> BufferedImage from TIFF is always 24 or 32 bpp
> ----------------------------------------------
>
>                 Key: IMAGING-141
>                 URL: https://issues.apache.org/jira/browse/IMAGING-141
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: TIFF
>            Reporter: Josh Highley
>             Fix For: Patch Needed
>
>
> When getting a BufferedImage from a TIFF, TiffImageParser.getBufferedImage gets the TIFF's
BPP from the TIFF tags, but at the end ImageBuilder.getBufferedImage() will always set the
BufferedImage ColorModel BPP to 32 for images with alpha and 24 bpp otherwise.  Many TIFFs
are 1 bpp (G3 and G4) so the BufferedImage should also be 1 bpp.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message