Page 1 of 1

[0.11.22] PNGs are too big, and problematic

Posted: Mon May 04, 2015 10:20 pm
by FeepingCreature
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:

Code: Select all

find -name \*.png |xargs -P 5 -I '{}' -exec pngcrush -ow -srgb 0 -rem alla '{}' '{}.tmp.png'
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.

Re: PNGs are too big, and problematic

Posted: Fri May 08, 2015 3:21 pm
by MF-
Please don't forget to also use the forum search.
https://forums.factorio.com/forum/sea ... GB+profile
Many threads, one specifically about these messages from the devs themselves: https://forums.factorio.com/forum/vie ... =41&t=3944

Re: PNGs are too big, and problematic

Posted: Tue May 12, 2015 11:08 pm
by FeepingCreature
Oh, good. Thanks.

In that case, devs: please don't forget to fix this for 0.12! :)

Re: PNGs are too big, and problematic

Posted: Wed May 27, 2015 1:38 pm
by cube
Yes, we should do that soon :)

I've added -blacken and -reduce to the flags to remove one more MB :-)