mojira.dev
MC-12699

Some PNGs using greyscale or tRNS are processed incorrectly

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

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?

insomniac_lemon

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....)

Yes, this is still an issue in 13w19a.

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.

5 more comments
insomniac_lemon

Still an issue in 1.8.3.

[Mod] redstonehelper

Since you attached textures_compressed_15w42a.zip, does this also affect 15w42a?

Yep, added.

Java itself handles our png files. Seems I might end up writing our own loader code for this. Definitely not happening before 1.10.

Not noticing any issues when trying that resource pack in 18w03b. This was probably fixed even earlier.

As for the "should" of this report (the game's image files should be compressed further), I'll not comment.

GFD

Erik Broes

Community Consensus

rendering, resource-pack

Minecraft 1.5.1, Snapshot 13w19a, Snapshot 13w21a, Minecraft 1.6, Minecraft 1.6.1, ..., Minecraft 1.8.3, Minecraft 1.8.8, Minecraft 15w42a, Minecraft 1.9, Minecraft 1.10

Minecraft 18w03b

Retrieved