0

I want to write a tiff image in Java which has 7 bands. My workflow looks as follows: I load a geotiff file, than, I select some 5pixel x 5pixel windows in the image and want to save them as a normal tiff image; the spatial information of the geotiff is not needed anymore. Now this worked fine until I noticed that of the 7 bands which were originally provided, just 3 bands remained in my output tiff images (5pixel x 5pixel each). I think the reason is that I have to define a type for the BufferedImage which in my case is RGB (BufferedImage.TYPE_INT_RGB). Is there a solution someone can suggest in order that I have output images with 7 bands, not 3?

Thank you very much for your help!

Best regards, Marvin

Mr M
  • 69
  • 8
  • 1
    please edit your question to show us the code you are using – Ian Turton Apr 23 '16 at 08:30
  • have you seen this?? http://stackoverflow.com/questions/13144189/jai-how-to-convert-4-band-32-bits-cmyk-image-into-png – gpasch Apr 23 '16 at 14:26
  • We don't know what you have done so far, so it's hard to suggest a fix... But most likely there's no (displayable) `BufferedImage` that will work well for this purpose. Try working directly with the `Raster` instead, and make sure you keep the 7 bands all the way from reading to writing. – Harald K Apr 25 '16 at 12:21

0 Answers0