VOGONS

Common searches


First post, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

So there's an image in PNG format, RGB, 3840x2160 pixel dimensions, around 23 MiB file size. I load it in GIMP (v2.8.20), export it as PNG, uncheck all boxes, compression level is set to 9 (default), and the result is around 20 MiB.

I open the same source image in Krita (v2.9.11) and save it as PNG, also uncheck all boxes and compression level is set to 9 by default, and the result is less than 18 MiB.

What's the catch?

DOS Games Archive | Free open source games | RGB Classic Games

Reply 1 of 7, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

Different implementations of DEFLATE possibly... https://en.wikipedia.org/wiki/DEFLATE
Or different compression algorithms used...
Or both?

For a sanity check: open each file (original, GIMP png, and Krita png) in gimp and save as PPM (human readable) then diff the files... there should be no differences between them all.

If there are differences, then something has gone wrong somewhere since both gimp png and krita png should be exactly like the original. If there are no differences then nothing has gone wrong and the two programs must use different compression implementations so pick which ever is best (I guess Krita since its smaller?).

You can diff the bits (hex editor) ofcourse, to get a better idea of what is different between the compressed versions, but working back from that... erm... not me.

Both are open source so futher digging in the relvant code areas would yeild the correct reason for this. Personally have no idea, never been bothered to look at the source for gimp (Although I'm pretty sure it uses zlib)... not used krita at all.

Reply 2 of 7, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

run pngcrush on it and see how small it gets!

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 3 of 7, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

I just tried pngcrush and it doesn't really do as good a job as Krita, the result is closer to GIMP.

spiroyster wrote:

For a sanity check: open each file (original, GIMP png, and Krita png) in gimp and save as PPM (human readable) then diff the files... there should be no differences between them all.

Thanks, I'll try that.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 5 of 7, by MrFlibble

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for the tip, PNGOUT gives a slightly better result than Krita.

UPD: However I noticed that PNGOUTWin reduces the ppi resolution of compressed images while Krita keeps the same ppi as the source file.

DOS Games Archive | Free open source games | RGB Classic Games

Reply 6 of 7, by vvbee

User metadata
Rank Oldbie
Rank
Oldbie
MrFlibble wrote:

However I noticed that PNGOUTWin reduces the ppi resolution of compressed images while Krita keeps the same ppi as the source file.

I don't see this with irfanview's implementation.

Reply 7 of 7, by VileR

User metadata
Rank l33t
Rank
l33t
MrFlibble wrote:

However I noticed that PNGOUTWin reduces the ppi resolution of compressed images while Krita keeps the same ppi as the source file.

It's probably stripping the pHYs chunk so the PPI you see is some default value of the viewer (typically 72, or maybe that's part of the PNG spec?). Tell it to keep that chunk.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]