A guide to compressing images for your game

RollingEyes

New Member
May 19, 2024
5
4
A few months ago, I encountered a challenge while developing my first game—a 2D simulator that required an extensive number of images/sprites, totaling thousands of PNG files. To efficiently manage this, I devised the following solutions:

Firstly, I ensured each image's resolution matched its content to minimize unnecessary space. Images with objects centered amidst empty backgrounds were cropped appropriately. For large quantities, automation tools in Photoshop proved invaluable.

Secondly, I organized these optimized images into spritesheets. Using Photoshop, I created templates where multiple images were grouped together. Scripts available on platforms like GitHub facilitated this process, arranging, for instance, 80 images of 100px by 100px into a single Photoshop file sized 800px by 1000px.

Finally, I compressed the spritesheet files using compressimage.io. This web tool allowed me to specify image dimensions, adjust compression levels, and convert them to the efficient WebP format.

By following these steps, I significantly reduced storage requirements and optimized performance for my game.