QOI (Quite OK Image Format) integration for Godot Engine 4.x.
This is a GDExtension library. Includes precompiled binaries for Windows
, Linux
, macOS
, iOS
, Android
and Web
, but it must compile for each platform which Godot Engine supports.
- Fastest encoding and fast decoding (when working with the QOI class in scripts)
- Editor integration (use
.qoi
as regular textures) - Cross-platform
- Simple API
- Large file size when working with
.qoi
files directly (compared to PNG or WebP. more than 2-3 times larger)
QOIvsPNG.mp4
Your support adds motivation to develop my public projects.
USDT-TRC20 TEw934PrsffHsAn5M63SoHYRuZo984EF6v
To download, use the Godot Asset Library or use one of the stable versions from the GitHub Releases page (just download the first archive from the assets, not one of the Source Code
s).
Note
If you download the addon manually, first go to the folder at the root of the archive, and then copy its contents to your project.
By default, after installation, QOI importer and QOI saver will be active.
The importer allows you to import .qoi
files and use them as regular textures in your project.
The saver allows you to save Image
and Texture2D
resources as .qoi
files using standard Godot tools.
But if you don't need these integrations and you want to use only the QOI
class, then you can disable them in the project settings. These settings are located here: rendering/textures/qoi/*
The entire API is in the QOI
class. It can be found in the documentation inside the engine.
# Read the QOI image from file
# @return null or Image
Image read(path : String) static
# Decode the QOI image from an encoded byte array
# @return null or Image
Image decode(data : PackedByteArray) static
# Write the Image as a file in QOI format
# @return code of Error
Error write(path : String, image : Image) static
# Encode the Image in QOI format as an array of bytes
# @return an array of bytes. If an error occurs, it is empty.
PackedByteArray encode(image : Image) static
func example():
QOI.write("user://example.qoi", load("res://icon.svg").get_image())
var img = QOI.read("user://example.qoi")
var enc = QOI.encode(img)
var dec = QOI.decode(enc)
var tex: = ImageTexture.create_from_image(dec)
$TextureRect.texture = tex
MIT license