PNG Settings

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

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.
everything can be a learning experience...
 

User avatar
sfan5
Moderator
 
Posts: 3706
Joined: Wed Aug 24, 2011 09:44
Location: Germany
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)
 

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

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...
everything can be a learning experience...
 

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

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??
everything can be a learning experience...
 

User avatar
TumeniNodes
Member
 
Posts: 2124
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: 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
Malicious intent, is NOT covered by the Fair Use Act.
 

User avatar
Linuxdirk
Member
 
Posts: 1035
Joined: Wed Sep 17, 2014 11:21
Location: Germany
GitHub: 4w
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?
 

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

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
everything can be a learning experience...
 

User avatar
TumeniNodes
Member
 
Posts: 2124
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: 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
Malicious intent, is NOT covered by the Fair Use Act.
 

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

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?
everything can be a learning experience...
 

Morn76
Member
 
Posts: 651
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:

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: 651
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:

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: 234
Joined: Thu Dec 01, 2016 23:44
Location: Athol, Massachusetts
GitHub: ChristoferL

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:

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: 651
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: 902
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: 651
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.
 

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

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?
everything can be a learning experience...
 

Morn76
Member
 
Posts: 651
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.
 

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

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.
everything can be a learning experience...
 

Morn76
Member
 
Posts: 651
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
Developer
 
Posts: 1169
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:

Code: Select all
find . -type f -name '*.png' -print0 | xargs mogrify -strip
 

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

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.
everything can be a learning experience...
 

sofar
Developer
 
Posts: 1169
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: 651
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: 2124
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: 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
Malicious intent, is NOT covered by the Fair Use Act.
 

Morn76
Member
 
Posts: 651
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.
 

Next

Return to Texture Packs



Who is online

Users browsing this forum: No registered users and 2 guests