Professor of Mathematics

Paata Ivanisvili

pivanisv@uci.edu · x.com/PI010101

Department of Mathematics, University of California, Irvine

Paata Ivanisvili

← Vibe projects

Image compression

Komla is a lossless JPEG recompressor. It makes existing JPEG files smaller and restores them byte for byte.

Komla has two JPEG models. Komla strong (komla compress, the command line’s default, or --strong) makes the smaller files. Komla fast (komla compress --fast, the web app’s default) is faster and saves less. The command line also has an older, much slower third mode, Komla maximum (--maximum), which is not part of this benchmark.

Benchmark

Held-out random set of 66 files (317.5 MB). The files were frozen by SHA-256 before Komla strong was developed (Komla fast’s model is older but was never tuned on them), and the set was run once.

Six bar charts: size reduction, compression speed, decompression speed, compress memory, decompress memory, and failed round trips. Komla is red. Dark bars are one thread and light bars are eight cores. Speed and memory use a logarithmic scale.
Dark bars are one thread and light bars are eight cores. Komla is red. Speed and memory use a logarithmic scale. *paq8px ran separately, so its times are indicative only, and it has no model for progressive JPEGs. Open the chart for the full-size image.

One thread

Tool Size % Compress MB/s Decompress MB/s Compress MiB Decompress MiB Fails
Komla strong24.738.048.8255120
Komla fast21.4413.3717.184370
JPEG XL18.269.2417.2714712950
Lepton (Dropbox)17.343.648.152801614
Lepton (Rust port)21.0511.7010.752813992
brunsli20.2910.2412.278442861
packJPG20.923.753.582832781
paq8px*23.000.010.01255325530

Eight cores

Tool Size % Compress MB/s Decompress MB/s Compress MiB Decompress MiB Fails
Komla strong24.7329.4537.601561500
Komla fast21.4443.4068.1773780
JPEG XL18.2616.1133.3514673070
Lepton (Dropbox)20.7110.2433.922942381
Lepton (Rust port)20.7330.8842.732913992
brunsli20.2910.2412.278442861
packJPG20.923.753.582832781
paq8px*23.000.010.01255325530

Higher is better for size and speed. Lower is better for memory and for failures, out of 66. brunsli, packJPG and paq8px have no threads, so their eight-core rows repeat the one-thread run.

Komla strong saves 24.73%, against 21.05% for the best practical tool, Lepton’s Rust port, so its files are about 4.7% smaller. It uses far less memory than the others.

On this set, for every other tool, either Komla strong or Komla fast is at least as good on every metric. The one tie is Komla fast against JPEG XL on one-thread decompression (17.18 against 17.27 MB/s).

paq8px is about 2.4 points smaller on sequential (baseline) JPEGs, at roughly 600 to 3,300 times the time. It has no model for progressive JPEGs. On the full set of 66 files, Komla strong saves 24.73% and paq8px saves 23.00%.

Caveats

A failed file is one the tool refused. It is counted at its original size. No tool restored a file wrongly.

Lepton (Dropbox) refuses 14 files on one thread and 1 file on eight cores. That is why its saving rises from 17.34% to 20.71%: the files it refuses are counted at their original size. JPEG XL here is its default effort. A higher effort makes it smaller and slower.

Strong mode is new, so it has not had the long field use the mature tools have. Its safety net checks the JPEG re-encoding: any file it cannot reproduce exactly is stored as it is. On this set that fallback was not used, and every file was recompressed. The check does not cover the model itself: on one file of an earlier test set (a rare layout with each component’s DC in its own scan), the evaluated strong mode wrote a file it could not restore, and the decoder was fixed before release 1.0.0 with every size unchanged. The command line does not decode its own output, so restore files once before deleting the originals; the web app does this for you.

Code

  • Download Komla 1.0.0 for macOS (Apple Silicon and Intel), Linux and Windows, with SHA-256 checksums. Run komla compress photo.jpg (Komla strong) or komla compress --fast photo.jpg, and komla decompress photo.jpg.komla.
  • The code is at github.com/paatai/Compress.
  • The full report is bench/results/JPEG_SPEED_REPORT.md.
  • The web app runs in the browser and offers Komla fast (the default) and Komla strong. Restoring a file does not ask which model was used.

Prepared with Grok Bot with Cursor agents.