PNG Settings

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

PNG Settings

by christoferlevich » Post

I keep getting this error - and I am certain I am simply missing something here...

"WARNING[Main]: Irrlicht: PNG warning: Interlace handling should be turned on when using png_read_image"

Is there a way to avoid this in the way I save a PNG? Should interlacing be turned off to avoid the error? I have so many png files and the warning doesn't identify the culprit.
everything can be a learning experience...

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: PNG Settings

by sfan5 » Post

This warning is caused by Irrlicht and you can safely ignore it.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

sfan5 wrote:This warning is caused by Irrlicht and you can safely ignore it.
LOL! I wish I could ignore it. I am trying to teach elementary students about the game from all aspects. They found the errors in their black box of messages... hahaha. In the next six months I am hoping to have them all creating their own mods, but part of that is trouble shooting, right?

I did find a way around it though! :)

Being from the old days of graphic arts, I remembered how file prep was so very important with image setters. I don't know if things are so touchy in graphics today, but they are in Minetest!

So the answer to avoiding the error " Irrlicht: PNG warning: Interlace handling should be turned on when using png_read_image" seems to be to save png files without compression or interlacing. The file can be RGB or index (it seems), but the other two settings seem to make the error pop up.

If there's more information to this that I find I'll share, or if anyone has anything to add that would be great! For now, I have to go change dozens of png images... lol Batch work...
everything can be a learning experience...

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

Ok - I know everyone says PNG errors can simply be ignored - but I can tell you that there are two that are killing my clients - keeping them from loading the world.

The interlace warning DOES seem to slow things down in loading, but not nearly as bad as iCCP: known incorrect sRGB profile kills it to the point of 5 plus minute loads - if it ever loads. When it finally loads I get nothing but a grey screen.

Anyone know a fix to this one? I have opened every png I created hoping to edit, but haven't found any profile saved with the files. Maybe there SHOULD be one?

At this point I am thinking about closing down use of it at the school and replacing every png with jpg and gif.

Any thoughts??
everything can be a learning experience...

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: PNG Settings

by TumeniNodes » Post

christoferlevich wrote:Ok - I know everyone says PNG errors can simply be ignored - but I can tell you that there are two that are killing my clients - keeping them from loading the world.

The interlace warning DOES seem to slow things down in loading, but not nearly as bad as iCCP: known incorrect sRGB profile kills it to the point of 5 plus minute loads - if it ever loads. When it finally loads I get nothing but a grey screen.

Anyone know a fix to this one? I have opened every png I created hoping to edit, but haven't found any profile saved with the files. Maybe there SHOULD be one?

At this point I am thinking about closing down use of it at the school and replacing every png with jpg and gif.

Any thoughts??
Have you tried using Krita to set the profiles?
I'm having a difficult time contemplating this error, as I have never encountered it. But I can say that Krita may be helpful.
There other software but I am only familiar with GNU Linux software, and I assume (unless a proressive school admin) if this is through a school, this is all either MS or Apple?

https://docs.krita.org/Profiling_and_Callibration
A Wonderful World

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: PNG Settings

by Linuxdirk » Post

sfan5 wrote:This warning is caused by Irrlicht and you can safely ignore it.
Why not only show them in verbose mode if they can be ignored?

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

TumeniNodes wrote:[Have you tried using Krita to set the profiles?
I'm having a difficult time contemplating this error, as I have never encountered it. But I can say that Krita may be helpful.
There other software but I am only familiar with GNU Linux software, and I assume (unless a proressive school admin) if this is through a school, this is all either MS or Apple?

https://docs.krita.org/Profiling_and_Callibration
I will check Krita out. We are using Windows 10 for everything, though I am thinking of loading Linux to a PC and be done with it. We also happen to have a subscription to Photoshop, so I used that over GIMP. PNG seems to be a pain. lol
everything can be a learning experience...

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: PNG Settings

by TumeniNodes » Post

christoferlevich wrote:
TumeniNodes wrote:[Have you tried using Krita to set the profiles?
I'm having a difficult time contemplating this error, as I have never encountered it. But I can say that Krita may be helpful.
There other software but I am only familiar with GNU Linux software, and I assume (unless a proressive school admin) if this is through a school, this is all either MS or Apple?

https://docs.krita.org/Profiling_and_Callibration
I will check Krita out. We are using Windows 10 for everything, though I am thinking of loading Linux to a PC and be done with it. We also happen to have a subscription to Photoshop, so I used that over GIMP. PNG seems to be a pain. lol
Everything's a "pain" these days... Never had "png profile issues" with good ole' crayons and paper... :D

edit> of course this could all be a setting in advanced setting too... 0_o
but, I would honestly take sfan5's advice to be honest... just stick a piece of duct tape over the screen where this error pops up ; )

One can never teach kids enough about the values of duct tape
A Wonderful World

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

OK - moving along in my attempt to resolve the matter, I have a question to ask about the file format used in the textures. PNG is the first choice, but is that because its the most modern and popular file format or is there a real reason for it? For instance, if I can create transparency through gifs, why wouldn't I always use the gif file format? Is PNG faster? Smaller? Does it have advantages I am not thinking about?
everything can be a learning experience...

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

christoferlevich wrote: The interlace warning DOES seem to slow things down in loading, but not nearly as bad as iCCP: known incorrect sRGB profile kills it to the point of 5 plus minute loads - if it ever loads. When it finally loads I get nothing but a grey screen.

Anyone know a fix to this one? I have opened every png I created hoping to edit, but haven't found any profile saved with the files. Maybe there SHOULD be one?
I'm currently looking into the "iCCP: known incorrect sRGB profile" warnings from my subgame. To that end I have written a Python 3 script that uses GraphicsMagick to report any embedded PNG color profiles.

So far it looks like these warnings are triggered whenever "Profile-color: 3144 bytes". Other profiles are not a problem. As a next step I'll see if I can modify my script to strip color profiles from affected files.

Here is the scanning script as it is right now:

Code: Select all

#!/usr/bin/env python3

top = "/home/martin/git/stampy_game/mods/"

import os, subprocess
from os.path import join

for root, dirs, files in os.walk(top):
	for n in files:
		if ".png" in n:
			f = join(root, n)
			cmd = ['gm', 'identify', '-verbose', f]
			r = subprocess.check_output(cmd).decode("utf-8")
			for x in r.splitlines():
				if 'rofile-' in x:
					print(f)
					print(x)
Sample output:

Code: Select all

$ python pngscan.py 
gm identify: iCCP: known incorrect sRGB profile (/home/martin/git/stampy_game/mods/wool/textures/wool_light_blue.png).
/home/martin/git/stampy_game/mods/wool/textures/wool_light_blue.png
  Profile-color: 3144 bytes
gm identify: iCCP: known incorrect sRGB profile (/home/martin/git/stampy_game/mods/throwing/textures/arrow_particle.png).
/home/martin/git/stampy_game/mods/throwing/textures/arrow_particle.png
  Profile-color: 3144 bytes
gm identify: iCCP: known incorrect sRGB profile (/home/martin/git/stampy_game/mods/hud/textures/poison_swirl.png).
/home/martin/git/stampy_game/mods/hud/textures/poison_swirl.png
  Profile-color: 3144 bytes
gm identify: iCCP: known incorrect sRGB profile (/home/martin/git/stampy_game/mods/hud/textures/hunger_swirl.png).
/home/martin/git/stampy_game/mods/hud/textures/hunger_swirl.png
  Profile-color: 3144 bytes

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

Update: It works! I'm using "-strip" to get rid of the bad color profiles and ran this over my subgame. Now I'm no longer getting any iCCP warnings on the MT console.

Here is the updated version of my script with color profile stripping:

Code: Select all

#!/usr/bin/env python3

# Strip color profiles of size 3144 from PNGs
# Needs GraphicsMagick

top = "/home/martin/git/stampy_game/"

import os, subprocess
from os.path import join

for root, dirs, files in os.walk(top):
	for n in files:
		if ".png" in n:
			f = join(root, n)
			cmd = ['gm', 'identify', '-verbose', f]
			r = subprocess.check_output(cmd).decode("utf-8")
			for x in r.splitlines():
				if 'Profile-color: 3144 bytes' in x:
					print(f)
					print(x)
					os.system("gm mogrify -strip %s" % f)
Edit: I've started a pull request for minetest_game about this: https://github.com/minetest/minetest_game/pull/1515

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

Morn76 wrote:Update: It works! I'm using "-strip" to get rid of the bad color profiles and ran this over my subgame. Now I'm no longer getting any iCCP warnings on the MT console.

Here is the updated version of my script with color profile stripping:

Code: Select all

#!/usr/bin/env python3

# Strip color profiles of size 3144 from PNGs
# Needs GraphicsMagick

top = "/home/martin/git/stampy_game/"

import os, subprocess
from os.path import join

for root, dirs, files in os.walk(top):
	for n in files:
		if ".png" in n:
			f = join(root, n)
			cmd = ['gm', 'identify', '-verbose', f]
			r = subprocess.check_output(cmd).decode("utf-8")
			for x in r.splitlines():
				if 'Profile-color: 3144 bytes' in x:
					print(f)
					print(x)
					os.system("gm mogrify -strip %s" % f)
Edit: I've started a pull request for minetest_game about this: https://github.com/minetest/minetest_game/pull/1515
I am excited to read about the progress you've made with this error. I just wish I knew how to run a script like this (still lots to learn).
everything can be a learning experience...

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

christoferlevich wrote: I am excited to read about the progress you've made with this error. I just wish I knew how to run a script like this (still lots to learn).
It's not that difficult:
1. install Python 3, https://www.python.org/downloads/
2. install GrapicsMagick (easily done on Linux with a package manager and on macOS with Homebrew, and supposedly there is even a GM package for Windows)
3. run the script, in Windows Python comes with a nice GUI where you can load and run scripts, on Linux/macOS you would probably use the terminal: "python my_little_program.py", or something like that. :-)

But you don't even need Python, if you can get either ImageMagick or GraphicsMagick installed, you can run either "gm mogrify -strip image.png" (for GM) or "mogrify -strip image.png" (for IM) on an image to strip it of its profile. Of course doing that for hundreds of images would get a bit tedious, therefore using Python, or Perl, or a shell language to loop over the files makes sense.

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: PNG Settings

by Napiophelios » Post

I put all my texture thru OptiPNG and haven't had any PNG errors since.
The visuals don't seem to have suffered any that I can tell.
Took less than a minute for all default Minetest Game images.

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

Napiophelios wrote:I put all my texture thru OptiPNG and haven't had any PNG errors since.
The visuals don't seem to have suffered any that I can tell.
Took less than a minute for all default Minetest Game images.
OK, I've tried this with OptiPNG. While file sizes came down slightly, the broken color profiles remained intact (on default settings).

Then I tried "optipng -strip all" and that seems to have done the trick.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

I am going to try ImageMagick and I'll check out Optipng too, but why don't I just go index colors in the PNG and eliminate all RGB? File size and image quality?
everything can be a learning experience...

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

christoferlevich wrote:I am going to try ImageMagick and I'll check out Optipng too, but why don't I just go index colors in the PNG and eliminate all RGB? File size and image quality?
Indexed textures have been tried before in minetest_game and quickly reverted as they created a problem with certain textures on some graphics cards: https://github.com/minetest/minetest_game/issues/1397

So you can certainly try converting everything to indexed in your game (or texture pack), but it might look bad and is not a good solution for minetest_game.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

Well, I don't want to make one bug trying to fix another... lol... thats for sure.
everything can be a learning experience...

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

christoferlevich wrote:Well, I don't want to make one bug trying to fix another... lol... thats for sure.
This particular bug was only a problem for textures with transparent pixels such as leaves, grass, and rails. Everything else was fine apparently.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: PNG Settings

by sofar » Post

Morn76 wrote:
christoferlevich wrote: 1. install Python 3, https://www.python.org/downloads/

No need to install Python. Just ImageMagick and a shell already is enough:

Code: Select all

find . -type f -name '*.png' -print0 | xargs mogrify -strip

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: PNG Settings

by christoferlevich » Post

It seems I have everything I need... ImageMagick installed on Win10 - I ran through command line and got this message... 'xargs' is not recognized as an internal or external command,
operable program or batch file.
everything can be a learning experience...

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: PNG Settings

by sofar » Post

christoferlevich wrote:It seems I have everything I need... ImageMagick installed on Win10 - I ran through command line and got this message... 'xargs' is not recognized as an internal or external command,
operable program or batch file.
Try using an actual version of Linux.

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

sofar wrote:
christoferlevich wrote:It seems I have everything I need... ImageMagick installed on Win10 - I ran through command line and got this message... 'xargs' is not recognized as an internal or external command,
operable program or batch file.
Try using an actual version of Linux.
Or install the Windows Subsystem for Linux in Windows 10. It's basically Ubuntu running on top of Windows 10.

Or learn how to use Python, it works great on Windows 10 too! :-)

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: PNG Settings

by TumeniNodes » Post

Morn76 wrote: Or install the Windows Subsystem for Linux in Windows 10. It's basically Ubuntu running on top of Windows 10.
Prob best to just run a straight up Linux system. This subsystem is still in it's infancy.
pick a distro, look into dual boot or VM, etc. and get help from the community you pick.

Although I also realize being in a school environment your options regarding these steps may be limited. I know some schools strictly forbid staff from altering any of these things due to warranty/licensing issues, etc..

This creates a difficult situation because, I am sure I would be opposed on this but, Linux does tend to have more specifically "targeted" software than Mac or Win in these sort of scenarios. And free compared to having a cost attached, which also presents a problem in a school environment.

This "MS working with Ubuntu" stuff has always seemed "sketchy" to me (this is not the first project they have collaborated on)... I get visions of headlines..." MS acquires Canonicle" : /

MS's history is wrought with them... "acquiring" pretty much any and all companies they "work with" eventually.
and Ubuntu (to them) has been a broken stitch in their side for a long time, just a nagging little pest which is always present, ever increasingly taking a little bite out of their pockets

(sorry for the rant) back to the show :P
A Wonderful World

Morn76
Member
Posts: 659
Joined: Sun Feb 16, 2014 19:45

Re: PNG Settings

by Morn76 » Post

TumeniNodes wrote:MS's history is wrought with them... "acquiring" pretty much any and all companies they "work with" eventually.
and Ubuntu (to them) has been a broken stitch in their side for a long time, just a nagging little pest which is always present, ever increasingly taking a little bite out of their pockets
You can also install other Linux distros under WSL, e.g. OpenSUSE or Arch. WSL is just a compatibility layer.

I think the use case for WSL is precisely running commands like sofar's xargs-based solution above. One advantage of WSL over a VM is that files can be easily edited under both Linux and Windows without having to deal with VM images and all that setup complexity.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests