The game’s script has been written, renders have been painstakingly crafted and you’ve lovingly plonked everything inside your favorite development framework. Just hit publish, right? Wrong.
Lots of developers throw the images they just rendered in DAZ3D into their game directory without considering whether that’s the best cause of action. DAZ3D for example, outputs uncompressed PNG images by default which are lossless, which is nice, but also take up a lot of disk space. Yes, your artwork deserves to be seen, but those pretty pictures don’t need to take up over 4MB per image. Compression and finding the right balance between quality and size are key in this case.
Converting the lossless images to lossy JPEGs is a good start and will shave off quite a few megabytes, but it will only work on images that don’t require transparency. However, there’s a better image format that’s supported by Ren’Py and it offers superior compression. WebP, developed by Google, offers the same advantages as PNG (mainly alpha-transparency), but due to its compression the resulting file-sizes are much smaller.
To create WebP versions of your existing images you have a couple of options. Google offers a command line application called cwebp and a Photoshop plugin. The popular open-source application GIMP has supported WebP since its 2.10 release.
You’ll probably want to convert your images in bulk and in that case a batch converter like XnConvert (freeware) is invaluable. The process is quite simple:
- First, whatever you do, make sure you keep your originals, the compressed versions are *not* a replacement!
- Install and open XnConvert.
- Drag the files you want to convert (or add them using “Add files”).
- In the “Output” tab select “WebP” from the “Format” list.
- Click “Settings” underneath the “Format” list.
- Drag the quality slider to a value between 95 and 100, this will ensure a good compression versus image quality ratio.
- Hit “Convert” in the lower-hand corner of the application window.
- Replace the converted WebP images with the old ones in your game directory.
And that’s it!
Care has been taken to compile this guide. If you spot any mistake, or if anything is unclear feel free to drop a comment below or join us on our Discord server.
Nice article! 👍
I should note that while we actively use webp file format, we got better results with jpg and even png in some rare cases. So it’s not a silver bullet and you may want to check different formats/variants where they are applicable.
All these programs need quality evaluators… One day, someone will make a converter that actually shows the “difference” as both a visual representation and a numerical one. (When you use a difference filter, anything NOT the same has a color. If the detail IS the same, it produces solid blackness. It is a better visual judgement than looking at two images side by side, but that helps too.)