YAPF — Yet Another Picture Format
  • C 56%
  • JavaScript 13.7%
  • HTML 12.3%
  • Python 6%
  • Shell 2.7%
  • Other 9.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-13 20:16:59 +00:00
build.bat Add files via upload 2026-05-12 03:16:20 +02:00
build.sh Add files via upload 2026-05-12 03:16:20 +02:00
LICENSE Initial commit 2026-05-12 00:15:44 +00:00
pikture.c Update pikture.c 2026-05-13 20:16:59 +00:00
pikture.h Add files via upload 2026-05-12 02:57:33 +02:00
README.md Update README.md 2026-05-12 17:59:11 +00:00

PIKTURE (PIK)

Fast. Small. Easy.

PIKTURE is a high-performance, lossless image format designed for systems where decoding speed and binary simplicity are critical. It is built on the FSE philosophy: Fast execution, Small file size, and Easy integration.

Why PIKTURE?

Standard formats like PNG are often bottlenecked by heavy decompression algorithms (DEFLATE/ZIP). PIKTURE replaces complex bit-shuffling with a hardware-friendly INDEX + Delta encoding, allowing the CPU to stream pixels directly to memory with minimal overhead.

Key Features

  • Lossless: 100% bit-perfect reproduction of RGBA data.
  • Ultra-Fast: Near-memcpy decoding speeds.
  • Small Footprint: Single-header C99 library with zero dependencies.
  • Smart Alpha: Automatically optimizes storage when transparency is not used.

Performance Comparison

Benchmark results for a 5K professional image (sample 5120x2880):

  • PIK Load Time: 0.111735 seconds
  • PIK Dimensions: 5120x2880

  • PNG Load Time: 0.193990 seconds
  • PNG Dimensions: 5120x2880

Implementation

The core library consists of only two files: pikture.h and pikture.c.

Building

The project is designed to be cross-compiled using the Zig toolchain for maximum portability across Linux, Windows, and macOS.

# Run the build script to generate static and shared libraries
./build.sh | UNIX (macOS / Linux)
./build.bat | WINDOWS

Technical Specification

PIKTURE uses a custom byte-stream protocol:

  • 0x00 - 0x3F: INDEX - Fetch pixel from a 64-color LRU cache.
  • 0x40 - 0x7F: DIFF - Apply small RGB deltas.
  • 0x80 - 0xBF: LUMA - Apply green-relative color deltas.
  • 0xC0 - 0xFD: RUN - Repeat previous pixel.
  • 0xFE: RGB - Full 24-bit color change.
  • 0xFF: RGBA - Full 32-bit color change.

MIT LICENSE