如何使用压缩图像?
https://www.npmjs.com/package/compress-images
GIF 图像是 - 4.1mb
;
GIF 图像变成了 - 4.2mb
;
压缩后的 gif 图像比以前更大。为什么?
我尝试:
compress_images('src/img/**/*.{jpg,JPG,jpeg,JPEG,png,svg,gif}', 'build/img/', {compress_force: false, statistic: true, autoupdate: true}, false,
{jpg: {engine: 'mozjpeg', command: ['-quality', '60']}},
{png: {engine: 'pngquant', command: ['--quality=0-20']}},
{svg: {engine: 'svgo', command: '--multipass'}},
{gif: {engine: 'gifsicle', command: false}});