I'm just experimenting with Gulp to simply optimize images. I find that imagemin-jpeg-recompress reduces JPGs more than the default optimizer that comes with gulp-imagemin. I'm wondering if there is a way to use gulp-imagemin
but swap out the jpegtran
plugin for the the imagemin-jpeg-recompress
.
I can't seem to find any detailed docs as to how this might work together.
I'm going to answer my own question. I could be wrong but it seems it's an easy process. Simply
require
the plugin (in this case, I want to useimagemin-jpeg-recompress
plugin). Then specify the plugin to use withinimagemin
via theuse
property ofimagemin
. I believe this will override the bundledjpegtran
optimizer that comes withimagemin
.