Texture in memory / on disk

Hi,

I was just wondering about textures in memory & on disk.

On disk my full-screen(1024x768) background is around 8kb, but when its loaded into the memory it takes about 8mb of texture memory.

Is this correct?
Is there any way to keep the size in the memory down? [import]uid: 103492 topic_id: 24618 reply_id: 324618[/import]

Break it up into smaller parts. The larger the image the more texture memory it takes up.

Will see it drop :slight_smile: [import]uid: 52491 topic_id: 24618 reply_id: 99734[/import]

Okey, one other thing I noticed is that with display.newImage call it only takes up 2mb, but with display.newImageRect it uses 8mb…? [import]uid: 103492 topic_id: 24618 reply_id: 99736[/import]

Images stored on disk are compressed. They are typically made up of four “channels”, one for red tones, one for green tones, one for blue tones and one for alpha transparency. Each channel is a 2 dimensional array of pixels. So if you have 1024x768 sized image, the actual image has 1024x768 red pixels, each one taking 1 byte of memory, 1024x768 green pixels, 1024x768 blue pixels and so on.

Some quick math: 1024 * 768 = 768,432 bytes per channel of memory. Multiply that by 4 channels and its 3.1MB of memory just to hold the color data. So an uncompressed in-memory image at 1024x768 is going to take 3.1+ megabytes. The software is manipulating these pixels and it’s very inefficient to try and uncompress this on the fly.

But it saves disk space to keep the images compressed.
[import]uid: 19626 topic_id: 24618 reply_id: 99771[/import]

Hi. Is very interesting. How many texture memory i can use? for exmaple i have a game with 8 images and the texture memory is 22 but when i add more images the texture memory is 24 and the game is slow.

My images are compresed the bigger image have 140 kb. I see your post. How i can create a game without have problems with texture memory.??? :frowning: [import]uid: 12275 topic_id: 24618 reply_id: 101492[/import]