1

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?

Matt Binz
  • 154
  • 1
  • 7
  • Are you sure Commons Imaging supports the "ExtraSamples" tag needed for alpha channels in TIFF? Do you even need to use Commons Imaging? From Java 9, ImageIO will come bundled with a TIFF plugin. There are also 3rd party TIFF plugins available for ImageIO for use with Java 8 or earlier. – Harald K May 07 '18 at 10:11
  • Unfortunately I have to use Java 6, so the bundled plugins in java 9 are not an option. Thanks for your advice. I'll take a look at the other options you mentioned. – Matt Binz May 08 '18 at 19:47

1 Answers1

1

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.

Matt Binz
  • 154
  • 1
  • 7