Minecraft does not process some PNGs correctly. Specifically, it does not seem to implement the tRNS specification fully, nor does it handle greyscale PNGs correctly. Attached are some vanilla textures from the most recent snapshot as of this writing (15w42a) that render incorrectly when compressed with ScriptPNG's most aggressive lossless setting. (If Mojang did this compression themselves, Minecraft's PNGs would be 34.45% [1299 KB] smaller, which is a not-insignificant amount of bandwidth.)
Linked issues
Attachments
Comments 15
Wow.... didn't think somebody would report this, let alone yesterday! Saves me the trouble, though.
I am a texture pack creator, and just got the idea to use an image compression tool, I found one for Ubuntu called "trimage" (Trim-age, like mixing trim and image. It uses optipng, advpng, and pngcrush), it cuts the size of my texture pack in half!
However, much like you, I noticed that images that were grayscaled displayed in Minecraft too bright and with transparency displayed as black. However, in GIMP, Chrome, EOG (Eye Of GNOME, the GNOME image viewer), and Nautilus thumbnails all display these images properly.
It would be nice to see this bug fixed, as it's an annoyance to actually find out which images are grayscaled (for some reason trimage seems to keep some of them indexed....) and then you gain a slightly larger file size (for me it added 1 KiB) which probably in larger texture packs (both in data and resolution) would add up much more than my texture pack.
Mojang should also fix this to encourage .PNG optimization a little more (or really, just not accidentally discourage it....)
Added a new .zip with 13w21a's textures compressed with pngslim 1.4.
This is still an issue with the new resource pack format. Added a new .zip with 1.6's textures compressed with pngslim 1.4.
Java itself handles our png files. Seems I might end up writing our own loader code for this. Definitely not happening before 1.10.
Interestingly, Irfanview and XnView also render these compressed PNGs in exactly the same way Minecraft does. Other applications, including Windows Photo Viewer, Google Chrome, or GIMP, will render them correctly. Does Minecraft share a library with XnView and Irfanview for rendering PNGs?