简体   繁体   中英

PageSpeed suggests jpg can be compressed 31% while grunt/imagemin says “Already Optimized”?

I'm following up to an advise by google pagespeed to optimize the static/images on our website. After i integrated grunt/imagemin with the default optimizer (jpegtran for jpg) I found that many image files are indeed optimized with an average of 20%, however the large image file that google pagespeed suggests is found to be already optimized?

Reading project/apps/frontend/static/images.optimize/<...>.jpg...OK Writing project/apps/setup/static/images/<...>.jpg...OK ✔ project/apps/frontend/static/images.optimize/<...>.jpg (already optimized)

Grunt config:

imagemin: { dynamic: { options: { optimizationLevel: 3 }, files: [{ expand: true, cwd: '<%= ... %>/static/images.optimize/', src: [ '**/*.{png,jpg,gif}' ], dest: '.../images/' }] } },

First, try changing the optimizationLevel. The highest compression level is 7, lowest is 0, and the default is 3.

If changing it to a higher level does not work, try using an online compressor, like kraken or tinypng , which also does jpg.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM