Large Texture Handling

Hello everyone!

Today, I’ve got some more or less theoretical questions. My task is to code an application for displaying and editing large images in strange formats (from 16154626 pixels to 40392501 pixels 8bit greyscale).[ btw.these images are result of gabor-analysis from audio-signals]. I want to do this in OpenGL cause I want to save resources for calculating the analysis.
My first question is :
Does it make sense to use OpenGL for such large images and if yes, how do I organize them in the texture-memory (texture compression)?
2nd :
I probably need to display up to 8 different images of this size in different canvases at the same time. Is this possible with JOGl?
3rd :
I need to handle those images like in photoshop etc. , eg. copy some parts from one to another or paint into the picture “live”. Are there any applications which do similar things with OpenGl?

Ok, that was it for now. Any help or suggestion is highly appreciated, have a nice day

big up

basti

[quote]My first question is :
Does it make sense to use OpenGL for such large images and if yes, how do I organize them in the texture-memory (texture compression)?
[/quote]
The only way to handle such large images is to break them up into different textures. Modern cards support up to 2048x2048 or even 4096x4096 (>= GeFX) texture sizes.

8-bit images cannot be compressed. If you actually need compression (it seems you’re after an image editor, that shouldn’t use lossy compression) and depending on the hardware available, you could pack multiple 8-bit data into RGB(A) images and compress them with DXT1/5. Then, you would use fragment shaders (it may possible with fixed function too) to pick each channel separately and display it as a single image.

[quote]2nd :
I probably need to display up to 8 different images of this size in different canvases at the same time. Is this possible with JOGl?
[/quote]
If you manage to put your images into textures, this would be the easy part.

[quote]3rd :
I need to handle those images like in photoshop etc. , eg. copy some parts from one to another or paint into the picture “live”. Are there any applications which do similar things with OpenGl?
[/quote]
The Nvidia SDK has many samples that have to do with real-time image editing, filtering, effects, etc. They also have a pretty decent image editor with many features, including the ones you mention (although I’m not sure it’s in the SDK).

IIRC, the above are implemented in d3d, but they should be helpful and easily ported to opengl. Also, they make heavy use of vertex/fragment shaders (not necessarily bad, just a warning).

Also helpful: the new EXT_framebuffer_object extension for offscreen rendering, render-to-texture, etc, and the ARB/EXT_pixel_buffer_object for fast and asynchronous pixel uploads/downloads/copies.

Good luck. :wink:

thanks alot for this quick and helpful answer! I’m going to write the “texturesplitter” now, the only thing that I worry about is what happens at the edges of textures if i use some anti-aliasing… but I’ll see…
big up

basti

Glad to help!

[quote]what happens at the edges of textures if i use some anti-aliasing…
[/quote]
Yeah, that’s a nasty problem. The solution will depend on what you’ll actually do and/or need. There’s an interesting paper on this problem, by Nvidia again, something about “Texture Atlases”. You’ll find it in the SDK.

OpenGL has a special feature called texture borders for problems with antialiasing and large textures. It seems to use a few pixels overlap on adjacent textures.

I don’t really know how it works, but the red book does:

http://chameleon.voxnet.gr/Books/book.php/english/html/the_red_book/chapter09.htm#2-4