Skip to content

Instantly share code, notes, and snippets.

@sergejmueller
Last active November 14, 2019 11:20
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sergejmueller/088dce028b6dd120a16e to your computer and use it in GitHub Desktop.
Save sergejmueller/088dce028b6dd120a16e to your computer and use it in GitHub Desktop.
mozjpeg vs. libjpeg-turbo – Output File Size and Execution Time

Lossless and progressive optimization of multiple (random picked, less than 1 MB) JPEG images with mozjpeg 2.0 and libjpeg-turbo.

Original Size mozjpeg Size libjpeg-turbo Size mozjpeg Speed libjpeg-turbo Speed
621 KB 612 KB 615 KB 0.658 s 0.297 s
505 KB 475 KB 477 KB 0.481 s 0.204 s
391 KB 376 KB 385 KB 0.846 s 0.441 s
888 KB 780 KB 794 KB 0.786 s 0.346 s
700 KB 668 KB 670 KB 0.765 s 0.320 s
425 KB 408 KB 415 KB 0.700 s 0.270 s
322 KB 309 KB 314 KB 0.389 s 0.164 s
Both libraries are called with:
time jpegtran -copy none -progressive img.jpg > compressed.jpg

Summary

  • mozjpeg generates 1,18% smaller* files as libjpeg-turbo
  • mozjpeg is 2,3x slower* as libjpeg-turbo

* Average based on table entries

@mindplay-dk
Copy link

I'm pretty sure the goal of mozjpeg us is produce better images - comparing the filesize alone probably isn't really meaningful without also comparing the (possibly subjective) image quality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment