Search code examples
javabufferedimagetiffalpha-transparencyapache-commons-imaging

How to retain transparancy in TIFF images using apache.commons.imaging in java


When calling Imaging.getBufferedImage(image); where image is a byte array containing a TIFF image with an alpha layer the resulting BufferedImage does not have an alpha channel. How can I either retain the alpha channel when calling Imaging.getBufferedImage() or add the alpha channel back to the BufferedImage that is returned?


Solution

  • Because apache.commons.imaging does not support the TIFF does not support the ExtraSamples, I determined I needed to find another way to read in the image.

    I ended up using a TIFF extension from TwelveMonkeys for ImageIO.