Skip to content

Add Extra Options to Vips? #2

@shoesforindustry

Description

@shoesforindustry

Hi Florian, I have been playing some more with your awesome vips driver and adding in some extra options...

    ‘optimize_coding’=> true
    ‘optimize_scans’ => true
    ‘trellis_quant’ => true
    ‘quant_table’  => 3 #same setting used by mozjpeg I believe
    ‘overshoot_deringing’ => true

  1. If you take a 1993 × 2491px jpg 1.2mb original colour photo with the options below you get a file of size of 231 KB - pretty good!
    ‘interlace’     => true
    ‘strip’         => true
    ‘quality’       => 50
  1. But with the options below you get a file of 182 KB, a handy saving, at the expense of some processing time.
    ‘interlace’     => true
    ‘strip’         => true
    ‘quality’       => 50
    ‘optimize_coding’=> true
    ‘optimize_scans’ => true
    ‘trellis_quant’ => true
    ‘quant_table’  => 3 #same setting used by mozjpeg I believe
    ‘overshoot_deringing’ => true
  1. Using mozjpeg on the same file at the same quality you get a file of 179 kb

  2. A webp at Q50 is quite a bit less at 148kb but it maybe perceptually a bit different on photos - but maybe OK?

(Of course if you go the jpg route only (no webp) then there is only one set of images in multiple sizes… which may or may not be important.)

At least for photos, these extra options look like a good compromise between image quality and image size.

*It would of course be nice to use mozjpeg with vips rather than the default (jpeg or jpeg-turbo?). But the install option for mozjpeg with vips on homebrew has been removed… and I’m not sure I want to build vips from scratch with mozjpeg…I may do it if the lock down continues much longer...

So Florian what are your thoughts on these extra options?

OSX so all installed via brew

  • vips 8.9.2
  • php 7.4
  • caddy 1.4
  • mozjpeg 3.3.1
  • webp 1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions