https://github.com/daneelsan/wolfram-qoi
A Wolfram Language paclet for manipulating the Quite OK Image (QOI) format
https://github.com/daneelsan/wolfram-qoi
c encoder-decoder image-processing wolfram-language
Last synced: 12 months ago
JSON representation
A Wolfram Language paclet for manipulating the Quite OK Image (QOI) format
- Host: GitHub
- URL: https://github.com/daneelsan/wolfram-qoi
- Owner: daneelsan
- License: mit
- Created: 2021-12-30T03:15:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-30T14:26:21.000Z (over 4 years ago)
- Last Synced: 2025-01-14T15:52:37.083Z (over 1 year ago)
- Topics: c, encoder-decoder, image-processing, wolfram-language
- Language: Mathematica
- Homepage:
- Size: 8.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```Mathematica
PacletInstall["https://github.com/daneelsan/wolfram-qoi/releases/download/release/QOI-1.0.paclet"]
```
Uninstall the paclet:
```Mathematica
PacletUninstall["QOI"]
```
# Usage
Load the QOI` package:
```Mathematica
Needs["QOI`"]
```
QOI symbols:
```Mathematica
In[]:= Names["QOI`*"]
Out[]= {"QOIDecode", "QOIEncode"}
```
Open the documentation of the `QOIDecode` function:
```Mathematica
NotebookOpen[Information[QOIDecode, "Documentation"]["Local"]]
```

# Samples
A few sample images come with the paclet:
```Mathematica
In[]:= DirectoryQ[samplesDir = PacletObject["QOI"]["AssetLocation", "samples"]];
Out[]= True
```
Use `ReadByteArray` to import the .qoi images as `ByteArray`s:
```Mathematica
In[]:= ToString[qoiByteArrays = ReadByteArray /@ FileNames["*.qoi", samplesDir]]
Out[]= "{ByteArray[<519653>], ByteArray[<652383>], ByteArray[<675251>], ByteArray[<16488>], ByteArray[<21857>], ByteArray[<24167>]}"
```
Test the `QOIDecode` function:
```Mathematica
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:
```bash
./scripts/get_qoi.sh
```
2. Build the `LibraryLink` library with the `build_library.wls` wolframscript:
```bash
./scripts/build_library.wls
```
The library will be stored in `LibraryResources/$SystemID/`:
```bash
$ ls LibraryResources/Linux-x86-64
wolfram-qoi.so
```
3. Build the `QOI` paclet using the `build_paclet.wls` wolframscript:
```bash
./scripts/build_paclet.wls
```
The paclet will be placed under the `build` directory:
```bash
$ ls build/*.paclet
build/QOI-1.0.paclet
```
4. Install the built paclet:
```Mathematica
PacletInstall[".../build/QOI-1.0.paclet"]
```