- May 1, 2020
- 879
- 2,002
Something has been bugging me since I started making this mod. I open an image in GIMP, make a change (or don't), and save the file, and the file size would increase somewhere between 3x and 4x. Telling GIMP not to include the metadata didn't help very much. A file would go from 51 KB to 176 KB, even if I had removed something!
It could be that GIMP isn't good at PNG compression, so I tried running the images through TruePNG and pngout with the most aggressive settings, which took a very long time and only reduced the file size by 10%. It took so much time for so little reward that I haven't bothered doing it. But it didn't make sense. These are the best PNG optimizers out there. Was GIMP putting something into the file that PNG optimizers couldn't remove? What the hell was going on?
I ran one of the game images through an image analyzer today and discovered that the files aren't actually PNG! They're WebP, renamed with a .png extension. They aren't even lossless WebP! These seemingly lossless images are actually lossy images in disguise!
I took 115 images from this mod and compared them to the same 115 images from the original game. The modded images, as created by GIMP, were collectively 18.5 MB, vs. 5.68 MB for the originals, making my images 3.25x larger. Using TruePNG and pngout, I was able to reduce my images to 16.6 MB. The files are still 2.92x larger, and it took the better part of half an hour. Meanwhile, in just a few seconds, I was able to convert the files to lossless WebP, which reduced their size to 11.5 MB. That's still 2.02x larger than the originals, but it's a 38% reduction over what GIMP natively produces, and the conversion time is essentially nothing.
I could try to figure out how much lossy compression is necessary get my file sizes down to the original level, but the quality would suffer for it. I'm going to stick with lossless and simply use a superior lossless format from now on. The mod is still going to be big, but switching to WebP will help a lot. Beta37 will be a smaller download than Beta36.
It could be that GIMP isn't good at PNG compression, so I tried running the images through TruePNG and pngout with the most aggressive settings, which took a very long time and only reduced the file size by 10%. It took so much time for so little reward that I haven't bothered doing it. But it didn't make sense. These are the best PNG optimizers out there. Was GIMP putting something into the file that PNG optimizers couldn't remove? What the hell was going on?
I ran one of the game images through an image analyzer today and discovered that the files aren't actually PNG! They're WebP, renamed with a .png extension. They aren't even lossless WebP! These seemingly lossless images are actually lossy images in disguise!
I took 115 images from this mod and compared them to the same 115 images from the original game. The modded images, as created by GIMP, were collectively 18.5 MB, vs. 5.68 MB for the originals, making my images 3.25x larger. Using TruePNG and pngout, I was able to reduce my images to 16.6 MB. The files are still 2.92x larger, and it took the better part of half an hour. Meanwhile, in just a few seconds, I was able to convert the files to lossless WebP, which reduced their size to 11.5 MB. That's still 2.02x larger than the originals, but it's a 38% reduction over what GIMP natively produces, and the conversion time is essentially nothing.
I could try to figure out how much lossy compression is necessary get my file sizes down to the original level, but the quality would suffer for it. I'm going to stick with lossless and simply use a superior lossless format from now on. The mod is still going to be big, but switching to WebP will help a lot. Beta37 will be a smaller download than Beta36.
Last edited: