Skip to content

Instantly share code, notes, and snippets.

@jbarth-ubhd
Last active November 21, 2022 15:12
Show Gist options
  • Save jbarth-ubhd/21d05cc592771a0f7ae61ee870a0d87e to your computer and use it in GitHub Desktop.
Save jbarth-ubhd/21d05cc592771a0f7ae61ee870a0d87e to your computer and use it in GitHub Desktop.

Comparison of text image compression

I've compared mozjpeg, webp, jpeg2000 (openjpeg & an proprietary encoder), jpeg-xl and avif with a text-like image containing circles with different width and tint.

See comparison-2022-11

The generated 920×920 px images (with different noise levels) are compressed with

/opt/mozjpeg/bin/cjpeg -quant-table 4 -q 75  

and the other methods are adjusted (quality level) to match file size of the mozjpeg output.

The original (excerpt stripe) of each noise level is testX.png.png .

All encoders are of Nov. 2022, but the proprietary jpeg2000 encoder, which is of 2020.

To me, it seems that webp gives the best result.

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