QOI
A Wolfram Language paclet for manipulating the Quite OK Image (QOI) format (https://qoiformat.org/).
Installation
Install the paclet (version 1.0
) from github releases:
PacletInstall["https://github.com/daneelsan/wolfram-qoi/releases/download/release/QOI-1.0.paclet"]
Uninstall the paclet:
PacletUninstall["QOI"]
Usage
Load the QOI` package:
Needs["QOI`"]
QOI symbols:
In[]:= Names["QOI`*"]
Out[]= {"QOIDecode", "QOIEncode"}
Open the documentation of the QOIDecode
function:
NotebookOpen[Information[QOIDecode, "Documentation"]["Local"]]
Samples
A few sample images come with the paclet:
In[]:= DirectoryQ[samplesDir = PacletObject["QOI"]["AssetLocation", "samples"]];
Out[]= True
Use ReadByteArray
to import the .qoi images as ByteArray
s:
In[]:= ToString[qoiByteArrays = ReadByteArray /@ FileNames["*.qoi", samplesDir]]
Out[]= "{ByteArray[<519653>], ByteArray[<652383>], ByteArray[<675251>], ByteArray[<16488>], ByteArray[<21857>], ByteArray[<24167>]}"
Test the QOIDecode
function:
In[]:= ImageQ /@ QOIDecode /@ qoiByteArrays
Out[]= {True, True, True, True, True, True}
Build
- The
qoi.h
library (https://github.com/phoboslab/qoi/qoi.h) is required for building theLibraryLink
library. Use theget_qoi.sh
bash script to do this:
./scripts/get_qoi.sh
- Build the
LibraryLink
library with thebuild_library.wls
wolframscript:
./scripts/build_library.wls
The library will be stored in LibraryResources/$SystemID/
:
$ ls LibraryResources/Linux-x86-64
wolfram-qoi.so
- Build the
QOI
paclet using thebuild_paclet.wls
wolframscript:
./scripts/build_paclet.wls
The paclet will be placed under the build
directory:
$ ls build/*.paclet
build/QOI-1.0.paclet
- Install the built paclet:
PacletInstall[".../build/QOI-1.0.paclet"]