[0.11.22] PNGs are too big, and problematic
Posted: Mon May 04, 2015 10:20 pm
When you start up Factorio on Linux, you may get a bunch of libpng warnings along the lines of "libpng warning: iCCP: known incorrect sRGB profile". From googling, this is because Photoshop actually puts weird invalid sRGB profiles in the PNGs it saves. (source https://wiki.archlinux.org/index.php/Libpng_errors )
So I've tried to use pngcrush ( http://pmt.sourceforge.net/pngcrush/ ) to strip out unneeded chunks and reset the sRGB profile to something innocuous. As a happy side effect, pngcrush also managed to reduce the size of the PNGs distributed with the game from 116MB to 105MB with no loss of quality afaict.
Here's the command I ran from my game folder to crush the PNGs:
Might be worth it to make something like this part of your release process? Could save a bunch of bandwidth on downloads...
[edit] remove xargs -n 1 as it's redundant with -I
[edit] Just want to add that the devs are aware of it! All is good forever.
So I've tried to use pngcrush ( http://pmt.sourceforge.net/pngcrush/ ) to strip out unneeded chunks and reset the sRGB profile to something innocuous. As a happy side effect, pngcrush also managed to reduce the size of the PNGs distributed with the game from 116MB to 105MB with no loss of quality afaict.
Here's the command I ran from my game folder to crush the PNGs:
Code: Select all
find -name \*.png |xargs -P 5 -I '{}' -exec pngcrush -ow -srgb 0 -rem alla '{}' '{}.tmp.png'
[edit] remove xargs -n 1 as it's redundant with -I
[edit] Just want to add that the devs are aware of it! All is good forever.