-
I am trying to optimize the compression to match a library called "jpeg-archive": https://github.com/danielgtaylor/jpeg-archive - one of the goals is to minimize storage and bandwidth usage when serving images over the web. I am using the jpegsave and have tried to adjust the following options: // default settings
$options = [
'Q' => 75,
'optimize_coding' => true,
'interlace' => false,
'strip' => true, // Metadata
'quant-table' => 0,
'overshoot-deringing' => false,
'trellis-quant' => false,
]; But I get some warnings when using settings other than the default: 'quant-table' => 1,
'overshoot-deringing' => true,
'trellis-quant' => true,
(process:15582): VIPS-WARNING **: 12:42:20.675: ignoring trellis_quant
(process:15582): VIPS-WARNING **: 12:42:20.675: ignoring overshoot_deringing
(process:15582): VIPS-WARNING **: 12:42:20.675: ignoring quant_table |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello again, Those options are for mozjpeg: https://github.com/mozilla/mozjpeg It's mozilla's libjpeg fork with a range of compression improvements. It can make JPEGs roughly 30% smaller without breaking compatibility. It does tend to be a lot slower, though I think that has improved recently. To use it from libvips, you need to build everything against mozjpeg rather than jpeg-turbo (the usual one). This usually involves building the entire libvips binary from scratch, unfortunately, though it depends what formats you want to support. There's a sample dockerfile for libvips with mozjpeg on ubuntu 20.04 here: https://github.com/jcupitt/docker-builds/tree/master/libvips-mozjpeg-ubuntu20.04 |
Beta Was this translation helpful? Give feedback.
Hello again,
Those options are for mozjpeg:
https://github.com/mozilla/mozjpeg
It's mozilla's libjpeg fork with a range of compression improvements. It can make JPEGs roughly 30% smaller without breaking compatibility. It does tend to be a lot slower, though I think that has improved recently.
To use it from libvips, you need to build everything against mozjpeg rather than jpeg-turbo (the usual one). This usually involves building the entire libvips binary from scratch, unfortunately, though it depends what formats you want to support.
There's a sample dockerfile for libvips with mozjpeg on ubuntu 20.04 here:
https://github.com/jcupitt/docker-builds/tree/master/libvips-mozjpeg-ubuntu20.04