I think this functions as a test case. For a game as simple as a chess UI, PNG would probably be fine unless you're code-golfing on the final output binary size or refusing to use common dependencies. But for some programs (e.g. large video games), preloading all your assets is very common and decoding speed can be crucial. Maybe the assets could even be left in compressed form in memory in order to reduce the system requirements? I'm not sure if this is common or not.
Side note: video game assets are often enormous in size because developers refuse to implement even very basic compression because of the supposed performance impact. Getting the decompression speed up can result in tremendous reduction in disk usage because it allows doing compression without losing performance.
This claim needs some real world evidence to back it up (and usually it's not about a performance impact, but instead a perceived image quality impact).
IME a lot of care is taken for compressing asset data, and if there would be a chance to reduce the asset size by another few percent without losing too much detail (that's the important part), it would be done. In the end, textures need to end up in memory as one of the GPU compatible hardware compressed texture formats (e.g. BCx) - which is important not only for reducing memory usage, but mainly for increasing texture sampling performance on the GPU (reduced memory bandwidth and better cache locality when reading texture data from GPU memory).
Those hardware-compressed texture formats rule out any of the popular image formats like JPEG, PNG etc... that might have a better overall compression, but are hard to decode on the fly to one of the hardware texture formats (but there are now alternatives like https://github.com/BinomialLLC/basis_universal), but even a generic lossless compressor (even good old zip) on top of BCx is already a good start.
We're talking lossless compression here, so image quality is not the issue.
Fortunately someone else has already done this research. There's a tool for Windows to control the compact.exe behavior for individual folders called CompactGUI: https://github.com/IridiumIO/CompactGUI
They maintain a database of compression results here: https://docs.google.com/spreadsheets/d/14CVXd6PTIYE9XlNpRsxJ...
Reductions in storage use of greater than 50% are so common that they're hardly even worth remarking on. My experience with compressing a bunch of games is that the biggest gains come from compressing bloated asset packs. Hard to know what else could be taking up more than 50% of the storage space in a particular game.
Those games typically don't need lossless image compression. There are much better (and faster) algorithms for lossy texture compression, many of which can even be decoded directly by the GPU. The S3TC family is one popular example.
One interesting commercial product in this space is Oodle Texture: http://www.radgametools.com/oodletexture.htm
Using a lossy hardware compression (like S3TC) that's natively supported by the hardware is especially a good way to save on GPU RAM! Double the texture resolution for free, essentially.
More generally, my point about video games was just that you can frequently cut their size by 50-75% just by turning on file compression on the game directory. Developers are obviously missing some easy wins in this area - including huge wins with lossless compression alone.
I tried using it in a WebGL game, but found that a) decoding was too slow, and b) the quality was too low.
PNG is much bigger, so you’d think it wouldn’t be good for a web game, but once an image has been downloaded and cached, the most important factor is the decode-and-upload time. On the web, PNG and JPEG handily beat basisu there.
In a different situation, basisu could have worked out for me. On native rather than web, maybe the decode time would have been fine. With more photographic rather than geometric assets, maybe the quality would have been fine.
1. Larger size on disk
2. Reduced quality at all MIP levels
3. Complexity of each platform wanting its own special format.
Basis fixes 1 (by adding an extra layer of compression) and 3 (by transcoding to almost any format at load time). But it doesn’t fix 2, and it adds another downside -- decompressing and transcoding is relatively slow.
> Side note: video game assets are often enormous in size because developers refuse to implement even very basic compression
Be generous; you even said in your previous sentence you don't know if it's common or not, so how do you know developers refuse to implement basic compression? If it's that easy, I'm sure there are plenty of AAA game studios (including mine) that will hire you to just implement basic compression.
There are enormous tradeoffs to make that are platform dependent; read speeds from external media are _incredibly_ slow but from internal media may be fast. Some assets are stored on disk to mask loading/decompression. Lastly, assets are just enormous these days. A single 4k texture is just shy of 70MB before compression and a modern game is going to be made of a large number of these (likely hundreds of them), and many games are shipping with HDR - these are multiples of the size. That's becore you get to audio, animation, 3d models, or anything else.
My current projects source assets are roughly 300Gb, and our on disk size is 3GB or so. My last project was 5Tb of source assets and 60GB on disk. Of course we're using compression.
The thing I said I didn't know whether it was common was keeping assets in compressed form in memory. I admit I don't know much of the specifics of how game rendering works. What I do know something about is the extremely poor compression applied to many video games in their on-disk form. I'm willing to grant that your studio may indeed be an exception to this, but the general principle isn't possible to deny. Just by enabling lossless Windows file compression on a game folder, you can frequently see the size of a game on disk drop by 50% or more, as I discuss in my comment here: https://news.ycombinator.com/item?id=34042164
Surely a lossless format designed specifically for encoding assets would be even more effective and fast than generic Windows file compression!
He understands why the Xbox doesn’t have the cd slot anymore.
Games heavy on prerendered video frequently were multi-disc: Final Fantasy 7 is three discs, 8 is four, 9 is four... Xenogears is multiple discs, as is Chrono Cross. Lots of JRPGs, though not exclusively: Riven was on 5 (!) discs, again a case of a lot of prerendered content.
It was pretty rare on PS2 with DVDs, and as far as I know totally eliminated on PS3 with Blu-ray (Metal Gear Solid 4 has/had an "install swap" where it would copy over from the disc only a chapter at a time, but all coming from one disc).
Then the concept made a comeback by the tail end of the PS4's life, with several games having "play" and "install" discs, though these aren't quite the same experience, as you just use the install/data disc once then put it away. Fittingly one of these PS4 multi-disc games is the remake of Final Fantasy 7 (one that covers only a relatively small portion of the original, to boot).
The last of us part 2 and GTA 5 both needed multiple discs on PS4.
> QOI has become my default choice for embedded image assets.
Embedded means they are working on stuff with low amounts of storage, computing speed and memory. If you are developing for embedded you are developing for electronics products typicyally. Every byte you can shave off can ultimately increase the return on investment. Using a traditional image format on embedded might not be possible because you don't have the program memory to store a complex decoder. If you decoder is 10 times bigger than the assets it is meant to decode, maybe there is not so much benefit in using it.
The simplest decoder you can go with would be just storing the value of the pixels in a bitmap and teading that out of that array. This however has the downside that you got no compression on the assets at all. If you have very simple color spaces (e.g. 1bit), tiny resolutions and few assets this might be an acceptable choice, but the choice gets worse as you get more assets, higher resolutions more channels or more bits per channel.
That means according to the author there is a space between just storing bitmaps and just using a png decoder where there were no good goto solutions before and they found a good solution with QOI.
What space? I feel like that's an assumption you're making and it might be true or it might not be, but even if you're right that's very vague and I want more specificity.
The pitch as I can tell is that the specification is simple. So the guy who spends a lot of time writing code based on specifications likes it?
I guess that’s the niche audience. Maybe a better pitch would be “image format specifications should be more like QOI”.