Page 1 of 1

Image requirements

Posted: Thu May 22, 2014 8:01 pm
by scorpii
Hi guys,
Are there any requirements on the images one can use (except the file format)?

The reason I'm asking is that I have a pretty large png image (6000x10000 pixels at 72 ppi), which I can load it seems, but I cannot draw quads from it. They just turn up checkered.

Re: Image requirements

Posted: Thu May 22, 2014 8:28 pm
by slime
Different systems have different maximum image sizes. In general it's safe to assume a computer will support at least 2048x2048 images. Computers with DirectX 10 / OpenGL 3 - capable video cards will likely support up to 8192x8192, and DirectX 11 / OpenGL 4 - capable cards will support up to 16384x16384.

You can check when the game is run with love.graphics.getSystemLimit("texturesize").

Also, keep in mind PNG images (and JPEG and most other formats except for Compressed Textures) are decoded into raw pixels when they're loaded from the disk into an ImageData or an Image. A single 6000x10000 image will take up about 225 megabytes of RAM as well as 225 megabytes of VRAM.

Re: Image requirements

Posted: Thu May 22, 2014 8:52 pm
by scorpii
Oh, it was just me being a noob then. :)
I was thinking I could load large images like that and then divide them into smaller quads which could be drawn when needed. I see now that it doesn't make sense.

So I guess I need to divide the actual png file in several smaller image files and then load them when needed in-game?