0
votes

I have an application that uses JAI to process images. It takes TIFF files, reads them, wraps the content into a SeekableStream then uses JAI.create to create the PlanarImage.

What I want to do is change the source from TIFF files to a component, which already exists, and which serves me the image data in the form of a raster stored in a byte array. I know the format of the raster data (width, height, bits per sample etc.).But I can't find a way to create a PlanarImage for JAI in the same way as before.

My only idea is to create a java.awt.Image from the raster and use that with JAI.create. Is this OK, or is there a better solution?

1

1 Answers

0
votes

You can use PlanarImage.wrap(bufferedImage) method.

Note: you can create bufferedImage from raster.

Furkan