Handling images of more than 64M

Hello all,

First i must admit that i have been programming is java for quite a time but am new to java2d or graphics.
I got confused of where i should place this question as i m using jogl.

My problem is this:

I have 3 files of .geo extension each of 492849281. The files consist of red,green and blue bands.
I have successfully manged to create a 5125123 file and display it, in crudest way possible…
The problem appears when i try managing the entire file 492849283.,Which amounts to around 72M if i m correct.
I have to scale this entire image to 512*512 for which i need to have this entire image once.
Is there any efficient way of placing these raw bytes into a bufferedImage which i can then convert to opengl texture?

The maximum size of the heap is 66M and i have tried using with java’s -Xm options.
of course i got stuck with OutOfMemoryError.
I was wondering whether i could divide the images into parts,scale it and then display it?

Actually i tried displaying 2464*2464,without scaling, in vain
Any ideas?

Regards.
shefali

you could try to use supply a ImageReadParam to imageio.

http://java.sun.com/j2se/1.4.2/docs/guide/imageio/spec/apps.fm3.html#998328

it specifically mentions memory usage. I haven’t used it myself though, but it’s worth having a look.

Are you sure that you tried the -X options correctly?

-Xmx256M

will give you 256MB of memory, most of which can be used for the heap.

Hello,

I did that as soon as i knew i could.
It helped to some extend but didnt actually solve the issue.
When i added some more code to it, like code to scale the image the problem persisted.
When i tried using this call for smaller images it gave BufferUnderFlow…
i got confused !!!
I think i may find a solution, dunno how, but i wont have chance to try anything new untill this weekend ends.

For anything this big Id strongly suggest you use JAI which is intelligent about breaking images down into tiles.