Save images in indexed 8-bit PNG format

Ideas for improvements and requests for new features in XnView Classic

Moderators: helmut, XnTriq, xnview

Post Reply
Janis
Posts: 11
Joined: Thu Jun 18, 2009 5:36 pm

Save images in indexed 8-bit PNG format

Post by Janis »

Hello!

I would like to suggest an option to save images in indexed 8-bit PNG format.

Thank you!
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Save images in indexed 8-bit PNG format

Post by marsh »

Janis wrote: I would like to suggest an option to save images in indexed 8-bit PNG format.
This might be what you're looking for:
View menu>Image>Convert to Colours...
Save as PNG afterwards.
Janis
Posts: 11
Joined: Thu Jun 18, 2009 5:36 pm

Re: Save images in indexed 8-bit PNG format

Post by Janis »

Hmm… Yes, it's exactly what I asked for and almost what I wanted. :) Thanks for the reply! Although having used Adobe Photoshop much, it's not easily found that I must to this in order to get PNG-8.

Why I said "almost what I wanted" is that Adobe Photoshop still beats XnView regarding the PNG file size (which is basically the biggest reason I would like to use PNG-8 instead of PNG-24 or 32).

I just tested by creating an image with 19 colours. I saved it as PNG-24 and PNG-8 with both XnView and Adobe Photoshop (CS2).
PNG-24 Xnview = 15.8 KB
PNG-24 Photoshop = 14.6 KB
PNG-8 XnView = 10.7 KB
PNG-8 Photoshop = 8.5 KB

Adobe Photoshop's size is smaller in both cases even with the additional Software and Gamma value meta data it adds that XnView doesn't have.

Also Photoshop has smarter algorithm (several options actually) for converting to 256 (or less) palette image. The gradient I had in my sample image looked quite nice with all three Photoshop's algoritms, while it looked quite terrible with XnView's. It would be very nice if XnView would improve its function too.
User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Re: Save images in indexed 8-bit PNG format

Post by Clo »

:arrow: Janis

:) Hello !

• Are a few KiB more so important, while nowadays the HDs reach 1TiB
and the RAM amounts follow accordingly ? :P

• Well, Pierre is the only developer of XnView, while Adobe has probably 2 or 3 dozens of programmers…
- However, if you want to get the smallest PNG weight, you can re-process them using the PngOut add-on.
The gain isn't huge, though, but you might get roughly the same sizes than using PhotoShop… ;)
Old user ON SELECTIVE STRIKE till further notice
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Save images in indexed 8-bit PNG format

Post by XnTriq »

  1. File » Export... » PNG » Color mode/Compression level
  2. Tools » Options... » General » Read/Write » Write » Parameters » PNG » Compression level
xnview ([url=http://newsgroup.xnview.com/viewtopic.php?p=75511#p75511]Uncalled-for format conversion[/url]) wrote:
rondus18 wrote:Alright, before I try it again I have a question about PNG compression. XnView gives me the option to chose between compression levels 0-9. PNGs are lossless so if I set it to the highest compression I won't lose any image quality, will I? I mean, what's the draw back to using level 9 compression over the default, level 6? Would a higher level change it to an 8-bit PNG?
Yes it's lossless, it's the compression level used by zlib
fnord: SuperPNG
SuperPNG is a free Adobe Photoshop plug-in for using PNG (“ping”) files. It is faster than Adobe's own PNG plug-in and saves considerably smaller PNGs.
eL_PuSHeR
Posts: 267
Joined: Sat Apr 25, 2009 9:23 am

Re: Save images in indexed 8-bit PNG format

Post by eL_PuSHeR »

You can dramatically reduce PNG filesize using one of these freebies:

Ken Silverman's PNGout

Cosmin Truta's OptiPNG

Both of them are free and work like a charm. I prefer Ken Silverman's better, although a tad slower.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)
Janis
Posts: 11
Joined: Thu Jun 18, 2009 5:36 pm

Re: Save images in indexed 8-bit PNG format

Post by Janis »

Thank you all for the replies!

I shall probably try one of those programs, and thanks for the File -> Export option! I didn't know about it, it looks good for testing with different parameters. And Adaptive mode was the one I thought ugly (I wander why it is the default one used by "Convert to colors" though...), Floyd Steinberg mode was quite OK.

By the way, what are the filters for saving as PNG? What do they do? Regarding the file size they all made it bigger. So I would think there is some other meaning.

P.S. OK, sorry, I understand now why Floyd Steinberg is not the default one. I was looking at a gradient, where Floyd Steinberg did the better job, but in case of plain colour it generated some fake pattern whereas Adaptive gave the same or a similar but plain colour not a pattern.
eL_PuSHeR
Posts: 267
Joined: Sat Apr 25, 2009 9:23 am

Re: Save images in indexed 8-bit PNG format

Post by eL_PuSHeR »

PNG preprocessing filters are for reducing filesize even more in a lossless fashion. For paletted images (8bpp and some <13bpp), NONE will yield the best results. For grayscale images, AUTO (MIXED) will usually yield the best results. For maximum compression is better to try them all (using a batch file for instance), but be warned that trying certain number of iterations will take some time.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)
Janis
Posts: 11
Joined: Thu Jun 18, 2009 5:36 pm

Re: Save images in indexed 8-bit PNG format

Post by Janis »

I see, thanks for the explanation!
Post Reply