Many image-files or many images in one file?

I was just wondering, whether I should have 1 big image-file (jpg or png) which would contain tens of little images used for 2D-game characters or for animation frames and I would crop those to the size I need in the game OR should I have all of those images in seperate files like I do have now?

When I started creating this game, I thought I have like maybe couple of pictures, but seems like I have closer to 40 pictures which are like size of 40*40 pixels now. So Im not going to transfer those to 1 big file for this game, but in future games Ill create, would the one-big-image-method make the game’s resources (graphics) smaller or increase the game’s speed?

[quote]So Im not going to transfer those to 1 big file for this game, but in future games Ill create, would the one-big-image-method make the game’s resources (graphics) smaller or increase the game’s speed?
[/quote]
No, it won’t make the resources smaller (at least not by much; you will save a few bytes overhead for the file headers etc).

No, it won’t increase the speed of the game in general. It will, however, increase the loading speed substantially if you retrieve the resources over a slow network connection. Also, if you load the images from a local file, the loading speed will increase somewhat (but not as noticeably).

However, I recommend to split / crop the image into the separate small tiles right at the start of the game, and not use the large master image in the animation/game loop.

Java2D allows to paint only part of an image, but on some platforms and/or with some Java versions, the performance will be very bad.

Ok, thanks. That was what I wanted to hear :slight_smile: