PNG compression - room to improve?

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

rotbus19
Posts: 38
Joined: Sat Feb 17, 2024 11:47 am

PNG compression - room to improve?

Post by rotbus19 »

Sample file attached, size = 248KB. Compression with different tools, using the same settings as much as possible (e.g. 256 colors):
So, XnView is 73% bigger than the smallest. All the other tools use https://github.com/shssoichiro/oxipng.

Could XnView use Oxipng to improve its compression?
You do not have the required permissions to view the files attached to this post.
User avatar
XnTriq
Moderator & Librarian
Posts: 6402
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: PNG compression - room to improve?

Post by XnTriq »

There's a color profile embedded in displaycomparisonfull.png.
Unlike some other programs (like PngOptimizer), XnView retains profiles.
IMO it's a bad idea to delete them without asking the user.
rotbus19
Posts: 38
Joined: Sat Feb 17, 2024 11:47 am

Re: PNG compression - room to improve?

Post by rotbus19 »

Thanks, I didn't check them all for stripping meta data but I just ran the latest Oxipng with '.\oxipng -o 4 displaycomparisonfull.png', and it reduced the test image to 93KB while retaining meta data / color profile.

So, even worse for XnView - 168KB versus 93KB, like for like.

P.S. Stripping the metadata only shaved off 2KB from the 93KB output.
sx090
Posts: 30
Joined: Thu Jan 11, 2024 8:49 am

Re: PNG compression - room to improve?

Post by sx090 »

oxipng is great, would be a lovely addition to a near perfect image handling tool (XnView that is :D ).
PNGs are sometimes a pain in the a** - so great to still see development in the encoder space :)
Marsu42
Posts: 100
Joined: Tue Sep 30, 2014 6:55 am

Re: PNG compression - room to improve?

Post by Marsu42 »

sx090 wrote: Tue Jan 28, 2025 8:07 am oxipng is great, would be a lovely addition to a near perfect image handling tool (XnView that is :D ).
Concerning compression or optimizing tools - instead of integrating 'em into XnViewMP it might be feasible to add post-scripting capability - i.e. to run any script "cmd.exe yadayada.cmd $filename" or "powershell yadayada.ps1 $filename" with the filename input given by XnViewMP?