Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pith-jpeg

pith-jpeg

pith jpeg lane: baseline and progressive JPEG decoding, byte-exact with libjpeg islow (zero-dep Rust)

CI CD Latest release semantic-release License: MIT

Install · Quick start · Suite contract

The pith suite contract

pith-jpeg is part of the pith suite (pith-hash). Every suite repository follows the same rules; CI enforces them mechanically:

  • Naming: a library is always pith-<domain> (pith-image, pith-audio, pith-zip, ...). The curator/repository of repositories is the bare pith-hash. Never invent a second naming scheme inside the suite.
  • Version pinning: cross-library dependencies pin ~0.1 (e.g. pith-image = { version = "~0.1", path = "../pith-image" }). The whole suite moves together inside 0.1.x; breaking changes require a suite-wide version bump, never a silent minor drift.
  • Zero third-party dependencies: every crate depends only on other pith-* crates plus std. scripts/check-zero-deps.py (run in CI) fails the build on any other crate, for normal, build and dev dependencies alike.
  • No unsafe: every crate root carries #![forbid(unsafe_code)].
  • Hex-exact vectors: reference.json at the repo root is the cross-language source of truth. The gen-reference binary regenerates it; CI verifies the committed copy is current (gen-reference verify), and CD ships the regenerated file with every SDK artifact. Python, Node and Go SDKs MUST test against the same bytes.

Repository layout

crates/            one published crate per suite lib (pith-<domain>)
tools/gen-reference  the vector generator binary (bin name: gen-reference)
sdk/python         ctypes wheel; build backend reads PITH_CDYLIB_DIR
sdk/node           koffi-based package; prebuilds/<os-arch>/ carry the cdylib
sdk/go             cgo binding; go.mod carries the module's cgo flags
fuzz/corpus        fuzz inputs, replayed by tests/fuzz_corpus.rs (parser crates)
reference.json     hex-exact cross-SDK test vectors

Overview

JPEG decoding per ITU T.81: baseline (SOF0), extended sequential (SOF1) and progressive (SOF2) Huffman-coded frames — spectral selection, successive approximation and EOBRUN included — with restart markers, 4:4:4/4:2:2/4:4:0/4:2:0 and other integral sampling factors, and 1- or 3-component output as pith_image::raster::Image (Gray/Rgb, 8-bit).

The pixel pipeline is a byte-exact transcription of libjpeg-turbo's islow integer IDCT, fancy triangle chroma upsampling and fixed-point YCbCr→RGB, validated against Pillow 12.3.0 fixtures byte for byte (see tests/fixtures/PROVENANCE.md). Arithmetic-coded, lossless, differential, hierarchical, 12-bit and CMYK/YCCK streams are refused with Error::Unsupported naming the coding process.

Install

Rust (the core library):

cargo add pith-jpeg

Python / Node / Go SDKs are published from the same cdylib on every release; see the release assets or the package registries for the matching version.

Quick start

Rust (the core library):

let img = pith_jpeg::decode(&bytes)?;

match img {
    pith_jpeg::Jpeg::Gray(g) => println!("{}x{}", g.width(), g.height()),
    pith_jpeg::Jpeg::Rgb(rgb) => println!("{}x{}", rgb.width(), rgb.height()),
}

decode never panics on untrusted input: malformed structure surfaces as Error::Truncated / Error::BadValue, refusals as Error::Unsupported. Hex-exact cross-SDK vectors — decode digests for every committed fixture plus the DCT/dequant numerics — live in reference.json (regenerate with cargo run --bin gen-reference, verify with cargo run --bin gen-reference -- verify).

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT © pith-hash

Metadata

Release files for pith-jpeg 0.1.1b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pith-jpeg 0.1.1b1
File Actions
pith_jpeg-0.1.1b1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pith_jpeg-0.1.1b1-py3-none-win_amd64.whl
pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_x86_64.whl
pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details for pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_aarch64.whl
pith_jpeg-0.1.1b1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pith_jpeg-0.1.1b1-py3-none-macosx_11_0_arm64.whl
pith_jpeg-0.1.1b1-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for pith_jpeg-0.1.1b1-py3-none-macosx_10_13_x86_64.whl

Total release size: 902.0 kB

Release files / pith_jpeg-0.1.1b1-py3-none-win_amd64.whl

Download URL pith_jpeg-0.1.1b1-py3-none-win_amd64.whl
Size 96.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1af6e1d537e0262ec4ab39204eae3cf239b39039292447ad46e092c734a21861
BLAKE2b-256 checksum
How to use checksums
480925d498c19b7f79feed795195d84fc1ba228dba8737b9e14853db1cbc8ca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_x86_64.whl

Download URL pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_x86_64.whl
Size 214.6 kB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
08a56ccfda823e7ca7fb0256adb18538f02ba25a603286f84439e39d252ba2cc
BLAKE2b-256 checksum
How to use checksums
ba3166149476aa81c08120c148aa14e648f3aa03e65fc1d94e9828c36b25b7fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_aarch64.whl

Download URL pith_jpeg-0.1.1b1-py3-none-manylinux_2_34_aarch64.whl
Size 209.8 kB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4869ba387087fc942c2ee4d93d4d3fae3bd24348645db500f77542f9b9df7a11
BLAKE2b-256 checksum
How to use checksums
96c96d62a9f867a455924a8b61f1a134fe47b38738e5d613dc3b10366cf3bfd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pith_jpeg-0.1.1b1-py3-none-macosx_11_0_arm64.whl

Download URL pith_jpeg-0.1.1b1-py3-none-macosx_11_0_arm64.whl
Size 188.3 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
152c0d824b9b77e9677726efdef6fd04e8fe6eb54faaf62f11e338973c010ed8
BLAKE2b-256 checksum
How to use checksums
80f09e2a9534b0469d64dc15ab9792f30e49ea753fc159e609fff098b4c476e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pith_jpeg-0.1.1b1-py3-none-macosx_10_13_x86_64.whl

Download URL pith_jpeg-0.1.1b1-py3-none-macosx_10_13_x86_64.whl
Size 192.6 kB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
a7211f2eacb683c7d94669d6e588bb3d70168d00af31ec99cf899d7ef95d31c3
BLAKE2b-256 checksum
How to use checksums
d84b21a2fe9baf8fbb83d19b3f4caa7f9c113b45e980149a9d0611f008b3e235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for pith-jpeg 0.1.1b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for pith_jpeg-0.1.1b1-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page