Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 13, 2019

what version used? it seems queer

@mindplay-dk

This comment has been minimized.

Copy link

@mindplay-dk mindplay-dk commented Nov 14, 2019

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