Improving the compression performance of MozJPEG

DegreeBachelor / Master
Supervisor(s)Nora Hofer, MA


MozJPEG is an open-source JPEG compression library developed by Mozilla in 2014. The target group is web publishers who want to improve user experience by reducing the time until browsers can render a website. To achieve this, MozJPEG uses various features of the JPEG standard and the novel trellis optimization. While this optimization leads to a better size-distortion tradeoff, its performance lags behind other known compression libraries.

The objective of the thesis is to implement and evaluate potential performance improvements to the MozJPEG library. It consists of four major steps: (1) understand JPEG compression, MozJPEG, and in particular trellis optimization; (2) build a benchmarking setup to test MozJPEG compression times on a variety of images, parameters, and platforms; (3) collect and analyze a broad set of images to better understand the necessary search space for trellis optimization; (4) propose and test modifications of MozJPEG that may improve compression performance.


  • The libjpeg–turbo Project. libjpeg–turbo Performance Study. 2021.
  • Hofer, N. and Böhme, R. Progressive JPEGs in the Wild: Implications for Information Hiding and Forensics. In Proceedings of the 11th ACM Workshop on Information Hiding and Multimedia Security (IH&MMSEC). ACM, Chicago, IL, 2023, pp. 47–58. [PDF] [Publisher] [Video]