Reputation: 648
I'm using LWJGL to create an OpenGL 3D application. For importing my images (for UV mapping) and converting them to Textures I use Slick2D:
bufferedImage = ImageIO.read(renderEngine.class.getResource("/images/textures/Stargate/image8192.png"));
objTextures.get(1)[0] = BufferedImageUtil.getTexture("", bufferedImage).getTextureID();
This method (second line) instantly uses 1 GB of RAM, but my Image has only the size of 8192x8192 --> 50 MB.
How can i fix this?
Upvotes: 0
Views: 161
Reputation: 6306
The amount of raw space depends on a number of things.
What is the color model?
What is the data type of the sample model?
Using an image type of TYPE_4BYTE_ABGR would lead to a minimum size of 256MB (8K * 8K * 4).
Using a data type of int (instead of byte) could increase that 4x.
And this is just the first line of reading into a BufferedImage
.
Upvotes: 3