Repository navigation
Home
PJA (packJPG Algorithm) recompresses JPEG, JPEG-LS and JPEG 2000 files without
loss: a photo shrinks by about a quarter, a JPEG 2000 codestream by about
8% (HTJ2K 11%, scanned 1-bit pages 70%), and pja x gives back the
original byte for byte. It is written in FreePascal, with the coefficient model's core in C and
some x86-64 assembly, and no libraries; it runs on Linux, macOS and
Windows (XP and later). PJA is the successor of
packJPG: a new codec and format of
its own, not compatible with .pjg.
pja a photo.jpg # -> photo.pja, about 27% smaller
pja x photo.pja # -> photo.jpg, the same file byte for byteNothing is written under an output's name unless it verified: a
decompresses its own result and compares it with the input first, and x
checks the size and the BLAKE3 hash the .pja carries.
PJA belongs to a family of recompressors that share that rule.
| Sibling | Formats | Successor of |
|---|---|---|
| PMPA | MPEG audio (MP1, MP2, MP3) | packMP3, packMP2 |
| PRA | raster images (PNM, BMP, TIFF, PSD, HDR, ...) | packPNM |
| PPA | the PNG family (PNG, APNG, MNG, JNG) | packPNG |
| PAIA | animated images (GIF, WebP, FLI/FLC, ANI, ...) | (new) |
| PJA | JPEG, JPEG-LS and JPEG 2000 | packJPG |
- Installing: the release binaries for each platform, and checking them
- Using pja: commands, switches, examples
- What PJA handles: which JPEG, JPEG-LS and JPEG 2000 files, and what goes as bytes
- Benchmarks: size and speed against packJPG, JPEG XL, Lepton, brunsli, general-purpose compressors and archivers
- Safety and robustness: damage, fuzzing, full disks, links and kills, measured against the others
-
Reporting bugs:
pja report, and what it does and does not contain - The zpaq-std plugin: PJA inside zpaq archives
- Library and 7-Zip: libpja, and PJA as a 7-Zip codec
- Platforms: what is built and tested where
- Building: from source, and running the tests
- Source layout and FreePascal pitfalls: for contributors
- How it works: a short tour, with links to the full notes
- Releases: what each version changed
- FAQ
The repository's own documents go deeper: CLI.md (the
command), CODEC.md (the codec, everything measured and
tried), FORMAT.md (the .pja file) and
POLICY.md.
The formats are stable since 0.9.0: what is fixed, and what may still come, is in doc/STABILITY.md.