#image-encoding #image #image-compression #graphics #encoding #codec #pixel

nightly moi

Encoder and decoder implementations for the MOI image compression format

2 releases

0.1.1 Jun 4, 2023
0.1.0 Jun 4, 2023

#47 in #image-compression

Unlicense

23KB
637 lines

MOI - The "More Optimized Image Format" for fast, lossless image compression

This repo contains the specification and an implementation of MOI, an image format designed to beat PNG in performance, size, and simplicity.

MOI was inspired by QOI, it takes the byte aligned tag encoding style of QOI and adds and tweaks some opcodes to achieve better compression while sacrificing some performance.

fmt  | encode  | decode  | size
moi  | 20.745s | 11.192s | 21.65%
qoi  |  6.774s |  5.712s | 25.58%
png5 | 111.28s | 15.128s | 23.66%
png9 | 512.90s | 15.021s | 22.92%

Benchmark timings were collected on an AMD Ryzen 7 3750H
The same test suite as QOI was used, ignoring two images with broken checksums.
Benchmark repository here


lib.rs:

encoder and decoder for the MOI image format, a format inspired by QOI, with more focus on beating PNG in all aspects (speed, size, simplicity).

Example

use moi::Image;

let image = Image {
  width,
  height,
  pixels,
};

let encoded = image.encode();
let decoded = Image::decode(&encoded)?;

assert_eq!(image, decoded);

Benchmarks

fmt  | encode  | decode  | size
moi  | 20.745s | 11.192s | 21.65%
qoi  |  6.774s |  5.712s | 25.58%
png5 | 111.28s | 15.128s | 23.66%
png9 | 512.90s | 15.021s | 22.92%

Benchmark timings were collected on an AMD Ryzen 7 3750H
The same test suite as QOI was used, ignoring two images with broken checksums.

No runtime deps