Page 1 of 1

[posila] [0.16.51] Graphics with 16bit color channels not displayed on OSX

Posted: Fri Dec 28, 2018 1:19 pm
by Boardy
In my latest playthrough with a friend of mine we use the NPUtils mod. Both of us didn't see some graphics from this mod. After reporting this in the mod's forum thread with a screenshot of the entities from his mod, the creator replied with a screenshot of his own, showing all items.

After doing some digging through the graphics inside the mod, it turned out that the .pngs we couldn't see all had 16b color channels. After converting them and trying out my custom version of the mod, the missing graphics were finally displayed (except in the tech tree, but those images were probably in a location I didn't convert).

Should factorio check this and convert the pngs -- each time the mods are loaded, sounds lengthy -- to images with 8bit color channels? Or is this intended and should the mod creators make sure they create correct pngs (making the mod smaller in the process)? I can imagine it would help modders if they would at least get a message that some images might not be displayed because of this.

The NPUtils mod is not the only mod showing this behaviour. E.g., also some Angel's mods appear to have missing buildings.

Re: [0.16.51] Graphics with 16bit color channels not displayed on OSX

Posted: Mon Dec 31, 2018 3:59 am
by TruePikachu
I'm of the belief that 32bpp (rgba8) is sufficient for a game like Factorio. And since mods need to be tailored to be compatible with the game anyway (by using the proper `.lua` files, for instance), I'd be perfectly happy for this to resolve towards mod authors needing to make sure things are set up correctly.

There's also the question of why the graphics aren't showing up at all, but nothing about that can be answered without a log file (which could include some PNG loading error messages, and would include stuff like the actual color depth in use on the system).

Re: [0.16.51] Graphics with 16bit color channels not displayed on OSX

Posted: Mon Dec 31, 2018 9:59 am
by Arch666Angel
I have run into this issue before as well. It apparently only affects MAC user, dont know why. I'm since then trying to avoid rendering stuff in anything more than 8 bit colors.

Re: [0.16.51] Graphics with 16bit color channels not displayed on OSX

Posted: Wed Jan 02, 2019 2:54 pm
by posila
Thanks for the report.
The problem is, we use OS-specific graphics libraries on Windows and macOS (GDI+ on Windows, NSImage from AppKit on macOS) to load image files, and while GDI always converts image to 32bit RGBA, NSImage loads it in whatever bitdepth the image was saved and we do conversion to RGBA ourselves. And we don't handle non 8bit-per-channel images properly there.
Frankly, even though sprites in 16bits-per-channel formats needlessly take up more space on disk, and load slower. It is just easier to fix the conversion.

Re: [posila] [0.16.51] Graphics with 16bit color channels not displayed on OSX

Posted: Mon Jan 07, 2019 10:14 pm
by posila
Fixed for 0.17
Thanks for the report.