I realize that file size has become much less of an issue in recent years because of larger bandwidth and faster download speeds. Still, one thing that has bothered me about PNG format images is that they tend to have large file sizes. Collectively, they can make files quite large (and, at some point, make the pk3 or wad take longer to load at game start). At any rate, I was poking around and came across an on-line tool named TinyPNG where I was able to reduce PNG image file sizes by around 70% or more.
The free version allows you to compress up to 20 files, with a maximum file size of 5 MB each. At present, the only way I have found to compress more than 20 files is to exit the web-site, re-enter it, and then drop the next 20 images into the tool. The speed with which the compression occurs is fairly high, and the compressed images are virtually indistinguishable from the originals. So I am very satisfied with the process and the results.
[EDIT: I didn't realize that there have been other posts about this topic.]
Reducing File Size for PNG Images
Moderators: GZDoom Developers, Raze Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
-
- Posts: 1578
- Joined: Tue Aug 05, 2003 10:01 am
- Location: Quatto's Palace
-
- Posts: 13717
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Reducing File Size for PNG Images
I really would not use an online utility for it, especially not for Doom resources.
The best utility to use is pngout. Make sure to run it with "/kgrAb"
After that, you can run deflopt (with /k) to further reduce its size by a few more bytes.
Unfortunately, the original site for deflopt has expired. It appears you can get it with PNGGauntlet, though.
The best utility to use is pngout. Make sure to run it with "/kgrAb"
After that, you can run deflopt (with /k) to further reduce its size by a few more bytes.
Unfortunately, the original site for deflopt has expired. It appears you can get it with PNGGauntlet, though.
-
- Posts: 1578
- Joined: Tue Aug 05, 2003 10:01 am
- Location: Quatto's Palace
Re: Reducing File Size for PNG Images
I'm not quite sure what your objection is based on. I just ran it for 83 files and it was reasonably quick and the results were, for all intents and purposes, lossless.Rachael wrote:I really would not use an online utility for it, especially not for Doom resources.
I will give this utility a try too, thanks.The best utility to use is pngout. Make sure to run it with "/kgrAb"
-
- Posts: 13717
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Reducing File Size for PNG Images
You'll lose the grAb and alPh chunks - which is vital information for GZDoom resources. grAb is for sprite offsets and alPh holds alpha information.ReX wrote:I'm not quite sure what your objection is based on. I just ran it for 83 files and it was reasonably quick and the results were, for all intents and purposes, lossless.Rachael wrote:I really would not use an online utility for it, especially not for Doom resources.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Reducing File Size for PNG Images
alPh is obsolete. It was once used for alpha textures in the software renderer, but that has been refactored so that it isn't needed anymore. The hardware renderer never even used it - it was just a crutch to patch over some shortcomings in the texture manager.
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Re: Reducing File Size for PNG Images
Is there any way to edit the grAb chunk without grabPNG or some other program made specifically to deal with it?
-
- Posts: 13717
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Reducing File Size for PNG Images
Hex editor?
I don't think there's any reason to compress data that small.
That being said, SLADE handles them perfectly, also.
I don't think there's any reason to compress data that small.
That being said, SLADE handles them perfectly, also.
-
- Posts: 1578
- Joined: Tue Aug 05, 2003 10:01 am
- Location: Quatto's Palace
Re: Reducing File Size for PNG Images
Good to know, thanks.Rachael wrote:You'll lose the grAb and alPh chunks - which is vital information for GZDoom resources. grAb is for sprite offsets .....
-
-
- Posts: 4141
- Joined: Thu Jul 17, 2003 12:19 am
- Graphics Processor: nVidia (Legacy GZDoom)
- Location: British Columbia, Canada
Re: Reducing File Size for PNG Images
Another vote for Slade3's png optimization
Spoiler:
Spoiler:
Spoiler:
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Reducing File Size for PNG Images
Rachael wrote:Hex editor?
That may throw off third party PNG tools because the chunk's CRC will no longer match. I know for sure that some tools will not handle this gracefully and start spamming error messages.
-
- Posts: 13717
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Reducing File Size for PNG Images
Oh, I forgot about the CRC. I think when I did it I manually updated the CRC myself.