niworkflows icon indicating copy to clipboard operation
niworkflows copied to clipboard

Consider replacing WEBP compression with guetzli

Open chrisgorgo opened this issue 8 years ago • 6 comments

This would allow for firefox and safari compatibility https://github.com/google/guetzli

chrisgorgo avatar Mar 18 '17 02:03 chrisgorgo

I instinctively recoil from jpg. I guess it'd be worth seeing, though.

effigies avatar Mar 24 '17 19:03 effigies

Actually MozJPEG might be better in terms of image encoding time: https://www.pixelz.com/blog/guetzli-mozjpeg-comparison/

chrisgorgo avatar Dec 13 '17 03:12 chrisgorgo

Apparently that's a library that drop-in replaces libjpeg, with a very limited CLI (I think it only takes JPEG as input). As a start, it would be good to verify that a lossless JPEG encoded with mozjpeg actually gets a size reduction from PNG. And then we can either try to swap out the library in Docker and save as JPEGs or save as lossless JPEGs and compress with mozjpeg using cjpeg.

Or other thoughts?

effigies avatar Dec 14 '17 14:12 effigies

doesn't compression increase the computational load on the browser?

oesteban avatar Dec 14 '17 15:12 oesteban

https://libjpeg-turbo.org/About/Mozjpeg

the addition of [mozjpeg features] improved the compression ratio by 4-15% (average 8.3%) in our testing but increased encoding time by approximately 4-7x. Decoding time was, however, reduced by anywhere from 2-62%.

I'm taking time as a proxy for load, but seems like a reasonable trade-off.

effigies avatar Dec 14 '17 16:12 effigies

Related: https://neurostars.org/t/trouble-with-html-report-for-fmriprep-v1-0-3/1246

chrisgorgo avatar Jan 25 '18 20:01 chrisgorgo