-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of QOI images #3726
Add support of QOI images #3726
Comments
Have you profiled image loading to be a significant bottleneck in your project? Lossless WebP encoding was added to Godot 3.4, and it already loads faster than PNG did. I feel adding image codecs for the sake of adding image codecs is something we should avoid doing in core. Doing so will increase the binary size of editor and export templates for no good reason. Instead, it would be better to expose the necessary API to make supporting more image formats possible with an extension. This may change if QOI ends up gaining significant adoption in popular applications, but I'd be surprised given its relatively niche use cases. History has shown that dethroning JPEG and PNG is a difficult task 🙂 |
See also #2461 for the avif format. |
I think that adding QOI would be a good thing. It's pretty small, fast, and is getting less and less niche. I know that as soon as I can I'm moving away from PNG. If nothing else, QOI seems "cooler" to devs and Godot having native support would be a good thing to do for the engine in the long term. Be a leader. Besides, qoi.h is only like, 600 lines long :p |
I'm afraid this is not how features are chosen for inclusion in Godot. See Best practices for engine contributors for more information. |
After finding out that GameMaker has an implementation of QOI (combined with BZip2) as the default image compression I decided to run a few tests. Since Godot compresses images using Lossless WebP by default, the comparison would be against it at max compression. While QOI undoubtedly encodes much faster (and likely has a close decoding speed), it loses almost every time in compression ratio, even to PNG. The situation changes if you include BZip2 compression (at best setting). While it now always beats PNG (oxipng -o 6), it sometimes beats Lossless WebP by being 10-23% smaller, sometimes loses by being 10-38% bigger. Note that losing is most of the cases. Not sure how this affects decoding speed. I believe the variation in size has something to do about color variation in the image. I also tried to apply Brotli and Zstandard to the QOI files, both at the best compression setting. In terms of compression, Brotli was the best, beating BZip2 most of the time. Zstandard didn't get a chance. This is just something I did out of curiosity and wanted to share since it's in the context of this proposal. Compressed QOI doesn't seem to compete with Lossless WebP to me. |
Since we already use zstd, maybe there's a setting of zstd with QOI that makes it enter the competition. |
Compressed QOI is an interesting idea, but it makes the file format no longer standard. This means ffmpeg can't accept it as input for Movie Maker usage, for instance. |
My consideration was Compressed QOI as a potential alternative to Lossless WebP compression. But as I said, WebP still wins. |
Describe the project you are working on
Making some game
Describe the problem or limitation you are having in your project
I want to use QOI images for fast loading. More info this: https://github.com/phoboslab/qoi
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Faster image loading
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
N/A
If this enhancement will not be used often, can it be worked around with a few lines of script?
nop
Is there a reason why this should be core and not an add-on in the asset library?
Yep, image decoding looks like a part of core
The text was updated successfully, but these errors were encountered: