[JAI] Loading images in a memory and time efficient manner using JAI
I am not currently using JAI, however I'd like to investigate to see whether
it may help resolve some of the problems I am seeing with loading large
images. Basically, I am storing the images in a database as a BLOB (raw
pixels). I retrieve the image data from the database ultimately as a byte
array. From this point I construct a BufferedImage using the following
a) Extract the width/height/image type from the byte data.
b) Read each pixel as an int and then invoke BufferedImage.setRGB().
It turns out that this approach isn't very memory/time efficient when
loading large images. It seems to use an excessive amount of memory since
the whole image is in memory all of the time.
I'm wondering if JAI would be of any help here? Given that I have raw pixel
data, how does JAI help in this case? Would I still be using a
"BufferedImage" in my program or would I be using some other data structure?
Does JAI tiling help out in any way here?
Thank you for any advice/suggestions.