Skip to content
YadeWira edited this page May 6, 2026 · 5 revisions

packJPG Wiki

packJPG is a lossless JPEG recompressor. It rewrites a .jpg file as a smaller .pjg file that decodes back to the bit-exact original JPEG. Typical reduction: 20–25 %.

Current release: v4.0d (LTS) — speed-polish update of the v4.0 LTS line. Format unchanged from v4.0c, encode/decode 6–14 % faster, ratio identical.


Quick links

For users

For builders

Background


What does packJPG do?

A JPEG file is a sequence of DCT coefficient blocks Huffman-coded with a fixed table. packJPG reverses the Huffman step, reorganizes the coefficients into per-component / per-position streams, and re-encodes them with a stronger arithmetic coder (PPM order-2 model). The result is byte-exact decompressible back to the original JPEG — same DCT data, same headers, same metadata, same bit-for-bit file.

Use it when you need the original JPEG back later (archival, version control of image-heavy repos, hosted-image "download original" buttons, photo backups). Don't use it for serving images on the web — re-encoding to WebP/JXL/AVIF makes more sense there.


Status

The v4.0 line is the current LTS. v4.0d is its latest update and the last with feature work. Future updates within this LTS line (v4.0e, v4.0f, …) will be bug-fix only.

Ratio plateau confirmed empirically — see Comparison with other tools for the numbers vs Brunsli, Lepton, and JXL.


Reporting bugs

Use the Issues tab. Please include:

  • packJPG version (packJPG -v or banner output)
  • OS and architecture
  • A sample .jpg that reproduces the problem (or a description if confidentiality forbids)
  • The exact command line and the full error message

Acknowledgement

Huge thanks to Matthias Stirner (@packjpg) — the original creator of packJPG. This fork stands entirely on the algorithm and codebase he authored and released as open source. See Migration from upstream for the relationship between this fork and his original repository.

Clone this wiki locally