PNG Settings

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

PNG Settings

by christoferlevich » Thu Jan 05, 2017 22:12

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.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: PNG Settings

by sfan5 » Fri Jan 06, 2017 17:57

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

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Sat Jan 07, 2017 13:45

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

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Thu Jan 12, 2017 11:30

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??
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: PNG Settings

by TumeniNodes » Thu Jan 12, 2017 13:40

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
Flick?... Flick who?
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: PNG Settings

by Linuxdirk » Thu Jan 12, 2017 13:52

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?
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Thu Jan 12, 2017 22:31

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
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: PNG Settings

by TumeniNodes » Thu Jan 12, 2017 23:32

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
Flick?... Flick who?
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Sat Jan 14, 2017 13:51

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?
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Sat Jan 14, 2017 15:17

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Sat Jan 14, 2017 15:41

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Sun Jan 15, 2017 01:42

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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).
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Sun Jan 15, 2017 02:48

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: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: PNG Settings

by Napiophelios » Sun Jan 15, 2017 03:32

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: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Sun Jan 15, 2017 12:17

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.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Mon Jan 16, 2017 11:41

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?
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Mon Jan 16, 2017 11:57

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.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Mon Jan 16, 2017 20:01

Well, I don't want to make one bug trying to fix another... lol... thats for sure.
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Mon Jan 16, 2017 21:02

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
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: PNG Settings

by sofar » Mon Jan 16, 2017 21:33

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
find . -type f -name '*.png' -print0 | xargs mogrify -strip
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Tue Jan 17, 2017 02:08

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.
 

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

Re: PNG Settings

by sofar » Tue Jan 17, 2017 04:46

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: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Tue Jan 17, 2017 11:22

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: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: PNG Settings

by TumeniNodes » Tue Jan 17, 2017 13:27

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
Flick?... Flick who?
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Tue Jan 17, 2017 15:08

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.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: PNG Settings

by TumeniNodes » Tue Jan 17, 2017 15:46

from what I am seeing, this is a fairly common issue under windows, (not specific to irrlicht)

I think you are getting this common error through irrlicht because your version of irrlicht is one built on windows?

I probably sound stupid because I'm trying to guestimate this issue, I have only ever used windows approx 8 months of my entire computer years.

But I found this, not sure if helpful..., seems close to sofar's answer but seems more tied into libpng (but he is correct imagemagick is your solution, just a diff command to try in the answer in the link
http://stackoverflow.com/questions/22125146/how-to-fix-libpng-warning-when-reading-interlaced-png

to answer your question about targeting which files are causing this error, it is basically any alpha textures, including dirt w/ grass sides, because the grass sides texture uses alpha transparency. (as I think morn mentioned?)

And this isn't even specific to the graphics card either, this seems to be (as I stated) a fairly common windows ... issue, and how it handles transparency, explorer 6 had a big issue with this too I guess? At a time when most other browsers did not (go figure)... it's something deep in the binaries of hades/// :D

edit: (btw, if I am making no sense and only inflating the problem, someone kindly let me know? and I will fade off slowly into the backdrop :D )
Flick?... Flick who?
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Thu Jan 19, 2017 18:44

I have a spare PC (Dell 7040, 8gigs ram) I'm turning into Ubuntu as a server. Windows is so very... well... its popular!
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Thu Jan 19, 2017 18:49

I have a spare PC (Dell 7040, 8gigs ram) I'm turning into Ubuntu as a server. Windows is so very... well... its popular!
 

Morn76
Member
 
Posts: 640
Joined: Sun Feb 16, 2014 19:45
GitHub: mdoege

Re: PNG Settings

by Morn76 » Thu Jan 19, 2017 19:08

christoferlevich wrote:I have a spare PC (Dell 7040, 8gigs ram) I'm turning into Ubuntu as a server. Windows is so very... well... its popular!

Ubuntu is the Windows of Linux distros. Impress us all and install Arch Linux instead. ;-)

One advantage that Arch has over Ubuntu is that you are building up from a minimal Linux install, so only packages you really need will be installed. E.g. a C compiler or X server probably are not required on a MT server (and this kind of software is always a security risk on a server of any kind). Ubuntu is a desktop OS, so it probably installs GBs of stuff by default which you don't even need or want.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: PNG Settings

by christoferlevich » Fri Jan 20, 2017 22:14

Morn76 wrote:
christoferlevich wrote:I have a spare PC (Dell 7040, 8gigs ram) I'm turning into Ubuntu as a server. Windows is so very... well... its popular!

Ubuntu is the Windows of Linux distros. Impress us all and install Arch Linux instead. ;-)

One advantage that Arch has over Ubuntu is that you are building up from a minimal Linux install, so only packages you really need will be installed. E.g. a C compiler or X server probably are not required on a MT server (and this kind of software is always a security risk on a server of any kind). Ubuntu is a desktop OS, so it probably installs GBs of stuff by default which you don't even need or want.


Just "looked" at arch and I have to say, it 'looks' like an ancient BBS. I am going to play with arch for a bit and if I can't get it, I'll try something else... but I will try. Only because I want the cleanest server I can get, right?
 

Next

Return to Minetest Texture Packs

Who is online

Users browsing this forum: No registered users and 13 guests

cron