daneelsan / wolfram-qoi

A Wolfram Language paclet for manipulating the Quite OK Image (QOI) format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"]]

ref/QOIEncode

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 ByteArrays:

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

  1. The qoi.h library (https://github.com/phoboslab/qoi/qoi.h) is required for building the LibraryLink library. Use the get_qoi.sh bash script to do this:
./scripts/get_qoi.sh
  1. Build the LibraryLink library with the build_library.wls wolframscript:
./scripts/build_library.wls

The library will be stored in LibraryResources/$SystemID/:

$ ls LibraryResources/Linux-x86-64
wolfram-qoi.so
  1. Build the QOI paclet using the build_paclet.wls wolframscript:
./scripts/build_paclet.wls

The paclet will be placed under the build directory:

$ ls build/*.paclet
build/QOI-1.0.paclet
  1. Install the built paclet:
PacletInstall[".../build/QOI-1.0.paclet"]

About

A Wolfram Language paclet for manipulating the Quite OK Image (QOI) format

License:MIT License


Languages

Language:Mathematica 54.5%Language:C 41.9%Language:Shell 3.6%