Page 1 of 1

Adding a coder for brunsli JPEG recompression

Posted: 2019-10-01T10:41:19-07:00
by Lode
Dear ImageMagick Forum Members,

I’d like to propose an improvement to ImageMagick adding support for brunsli, a lossless JPEG recompression system, also a part of the JPEG XL draft. I'm Lode Vandevenne from Google Research and I have worked before on other image compression projects such as lodepng, zopflipng, brotli, brunsli, webp, pik and JPEG XL, and I care for making the internet faster.

Brunsli is a lossless JPEG recompressor which allows for a further 22% decrease in image size while allowing the original JPEG to be recovered byte-by-byte. It is part of the JPEG XL Image Coding System Annex M "Lossless JPEG1 recompression".

You can try out brunsli easily. Its github repository has simple CLI tools:

Code: Select all

$ cbrunsli xyzzy.jpg xyzzy.jxl
$ ls -l xyzzy*
-rw-r--r-- 1 lode primarygroup 148685 Oct  1 19:37 xyzzy.jpg
-rw-r--r-- 1 lode primarygroup 117533 Oct  1 19:37 xyzzy.jxl
$ dbrunsli xyzzy.jxl xyzzy-restored.jpg
$ ls -l xyzzy*
-rw-r--r-- 1 lode primarygroup 148685 Oct  1 19:37 xyzzy.jpg
-rw-r--r-- 1 lode primarygroup 117533 Oct  1 19:37 xyzzy.jxl
-rw-r--r-- 1 lode primarygroup 148685 Oct  1 19:37 xyzzy-restored.jpg
$ sha256sum xyzzy.jpg xyzzy-restored.jpg
e8cbb0107b2b43e4fe09aaa419f18050683b417659b1d99ca9e2dcc9f00052d2  xyzzy.jpg
e8cbb0107b2b43e4fe09aaa419f18050683b417659b1d99ca9e2dcc9f00052d2  xyzzy-restored.jpg
We consider brunsli a very promising approach for transmitting existing JPEG images on the internet faster and with smaller data budgets – and particularly so because it works without any loss. To this end, tooling support of course would need to be there, and ImageMagick is the most central “Swiss Army Knife” for imaging in the web ecosystem. I played around with this idea already and made a prototype ImageMagick integration here:
https://github.com/lvandeve/ImageMagick ... 13091e7572

We can extend the brunsli integration code to full JPEG XL support later. At Google Research, we have tested and fuzzed it extensively – you can consider it a high quality piece of software. The authors responsible for 7zip M-filter already integrated brunsli there.

Kindest regards,

Lode Vandevenne

Re: Adding a coder for brunsli JPEG recompression

Posted: 2019-10-01T16:20:57-07:00
by magick
We'll add support for brunsli likely this weekend. Thanks for the suggestion.