nipreps / niworkflows

Common workflows for MRI (anatomical, functional, diffusion, etc)
https://www.nipreps.org/niworkflows
Apache License 2.0
86 stars 52 forks source link

Consider replacing WEBP compression with guetzli #142

Open chrisgorgo opened 7 years ago

chrisgorgo commented 7 years ago

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

effigies commented 7 years ago

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

chrisgorgo commented 6 years ago

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

effigies commented 6 years ago

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?

oesteban commented 6 years ago

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

effigies commented 6 years ago

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.

chrisgorgo commented 6 years ago

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