PNG not exporting as 8 Bit depth - for Websites

Reproducing the problem (Windows 10) (Krita 5.0.2):

1- Open a PNG image with 32 Bit depth on Krita

2- Image > Convert Image Color Space:

Model: RGB
Depth: 8-bit
Profile: (I tested them all with no change in the result)

3- File > Export: PNG

Options: (I tested them all with no change in the result)

RESULT: PNG file with 24 Bit depth

Note: If exported as GIF it results in a 8 Bit depth just fine.

Could someone help? Is it a BUG?

1 Like

It is 8 bit PER CHANNEL. Not 8bit total.

Thank you for the reply. How to export 8 bit total then?

The strange thing is that it works with GIF files. The purpose is to export to the smaller PNG file size possible for web. I am currently using Paint.net software to accomplish this but I would like to do directly on Krita.

I don’t think it is possible. I mean you technically can use ffmpeg but that is a pretty round about way to go about it. That said, generally optimizers are better at these things then programs. There are also other options to save space from webp to svg if it is simple designs.

Thanks. I think it would be a good feature for Krita to adopt, I believe the vast majority of programs have more options when it comes to exporting to PNG (and the other formats too). I still miss Fireworks, it would be great to see the final file size as you select export options.

A .png file that was converted to 8-bits total colour depth would be the equivalent of a .gif file.
If you want to reduce the file size of a .png file then there is pngquant:
https://pngquant.org/

That uses lossy compression and also uses dithering. It’s only suitable for website display storage, not for WIP images.

1 Like

Hi AhabGreybeard, thank you for the sugestion.

What actually happens is that technically it is known that PNG is in many cases superior to GIF.

An old article: Replace GIF with PNG Images - portable network graphics images compress more efficiently than gifs - WebSiteOptimization.com

If I get a PNG image exported directly from Krita even using compression tools like the one you indicated, the file size will be WAY much bigger than if I had managed to export it in 8 bit.

Exporting in other programs to PNG and GIF in 8 bit the result was that PNG has a much better quality and even a smaller file size, and I can still use a compression tool.

It would be very helpful to be able to use Krita to export to web like the tool you can see in this image:

If anyone knows any good tool to transform PNG into 8 bit that works on windows I would appreciate the recommendation.

I recommend this tool for compression after the file is already 8 bit: http://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer

I did tests with several lossy PNG optimizer programs and this was my conclusion:

The best program ever to convert PNG to 8-bit is Color Quantizer

Color Quantizer is a program rich in options, it was the program that achieved the best result in generating the smallest possible file in PNG 8-bit (256 colors) without losing quality or transparent background, unfortunately it is not being updated anymore.

It uses TruePNG library for lossy compression
http://x128.ho.ua/clicks/clicks.php?uri=TruePNG_0625.zip

Documentation:

The second best was Compress or Die:

It wasn’t exactly what I was looking for because it’s online, that being said, it’s a program that seems to outperform all other current online optimizers, offers a lot of options, and has incredible image quality.

In last place was: Imagine

Despite being behind the top 2 it has his advantages. It works on Windows, macOS and Linux. Like the others it has batch process option, and it’s fast. It has better quality and smaller PNG file size than the Paint.net software that I used for this purpose until now.

It uses pngquant library for lossy compression
https://pngquant.org/

But you have to update the pngquant version in Imagine otherwise the end result is horrible.

Download: https://pngquant.org/pngquant-windows.zip and replace the file pngquant.exe in the folder C:\Program Files\Imagine\resources\app.asar.unpacked\bin\win

Hope they keep updating pngquant and improving it.

Just to leave a reference I used a file with 1.68Mb 32 bit depht and in all cases I exported it to 8-bit (256 colors) resulting in:

296K - Color Quantizer
372K - Compress or Die
432K - Imagine

My hopes are that Krita can adopt better options when exporting a PNG file

3 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.