Image requirements

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
scorpii
Prole
Posts: 9
Joined: Tue Apr 22, 2014 9:29 pm
Location: Sweden

Image requirements

Post 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.
Löve noob
Lua noob
Life noob
User avatar
slime
Solid Snayke
Posts: 3159
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Image requirements

Post 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.
User avatar
scorpii
Prole
Posts: 9
Joined: Tue Apr 22, 2014 9:29 pm
Location: Sweden

Re: Image requirements

Post 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?
Löve noob
Lua noob
Life noob
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests