-
Notifications
You must be signed in to change notification settings - Fork 2
Home
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.0e (LTS) — adds an embedding library / DLL /
.soAPI (multithreading on by default) and an optional decompression-bomb guard (-maxout/pjglib_set_max_output_size). On-disk.pjgformat unchanged — output is byte-exact with v4.0b/c/d.
- Install → see the README
- Quick start → README › Usage
- CLI reference → README › Command-line switches
- FAQ — common questions
- Troubleshooting — known errors and workarounds
- Use cases — what packJPG is good (and not good) for
- Build from source → docs/howtocompile.md
- Versioning policy → docs/versionnumbering.md
- Developer functions → docs/developer.md
- Comparison with other tools — packJPG vs Brunsli vs Lepton vs JXL
-
Migration from upstream — for users coming from
packjpg/packJPG - Release archive — historical release index
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.
The v4.0 line is the current LTS and is format-stable: every release since v4.0b produces byte-exact .pjg output. v4.0e is the latest update — it adds the embedding library/DLL/.so API and a decompression-bomb guard without changing the on-disk format. Updates within this LTS line stay format-stable (tooling and API additions are fine; anything that would break the .pjg format lands in a future v4.1).
Ratio plateau confirmed empirically — see Comparison with other tools for the numbers vs Brunsli, Lepton, and JXL.
Use the Issues tab. Please include:
- packJPG version (
packJPG -vor banner output) - OS and architecture
- A sample
.jpgthat reproduces the problem (or a description if confidentiality forbids) - The exact command line and the full error message
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.
And a heartfelt thank-you to the encode.su community — the data-compression forum where most of the feedback, ideas, and stress-testing for this fork comes from. Their questions, benchmarks, and willingness to push back on design choices have shaped every release since v3.0. Special thanks to everyone who has tested builds on uncommon hardware, reported edge cases, suggested format improvements, and kept the conversation around lossless JPEG recompression alive.