4.7. Compress Images

简介:
		
optimizationLevel: 5, //类型:Number  默认:3  取值范围:0-7(优化等级)
progressive: true, //类型:Boolean 默认:false 无损压缩jpg图片
interlaced: true, //类型:Boolean 默认:false 隔行扫描gif进行渲染
multipass: true //类型:Boolean 默认:false 多次优化svg直到完全优化
		
		
var imagemin = require('gulp-imagemin');
 
gulp.task('images', function() {
  return gulp.src('src/images/**/*')
    .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
    .pipe(gulp.dest('dist/assets/img'))
    .pipe(notify({ message: 'Images task complete' }));
});		
		
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
5月前
|
Python
已解决:_tkinter.TcLError: couldn’t recognize data in image file “Image/nakamuraan.gif”
已解决:_tkinter.TcLError: couldn’t recognize data in image file “Image/nakamuraan.gif”
188 1
|
应用服务中间件 Perl
tomcat上传图片报错com.drew.imaging.jpeg.JpegProcessingException: JPEG data is expected to begin wit
tomcat上传图片报错com.drew.imaging.jpeg.JpegProcessingException: JPEG data is expected to begin wit
105 1
|
人工智能 语音技术 Android开发
format和save_wav
format和save_wav
75 1
|
应用服务中间件 Perl
tomcat上传图片报错com.drew.imaging.jpeg.JpegProcessingException: JPEG data is expected to begin with 0xFFD
tomcat上传图片报错com.drew.imaging.jpeg.JpegProcessingException: JPEG data is expected to begin with 0xFFD
124 0
|
缓存 前端开发 JavaScript
浅析data:image/png;base64的应用
浅析data:image/png;base64的应用
907 0
浅析data:image/png;base64的应用
错误及原因:Empty JPEG image (DNL not supported)
错误及原因:Empty JPEG image (DNL not supported)
152 0
使用jpeglib直接把NV12转为jpeg文件的代码
使用jpeglib直接把NV12转为jpeg文件的代码
146 0
OSError: image file is truncated (12 bytes not processed) Premature end of JPEG file
OSError: image file is truncated (12 bytes not processed) Premature end of JPEG file
520 0
|
数据挖掘 TensorFlow 算法框架/工具
Load and preprocess images
This tutorial shows how to load and preprocess an image dataset in three ways. First, you will use high-level Keras preprocessing utilities and layers to read a directory of images on disk. Next, you will write your own input pipeline from scratch using tf.data. Finally, you will download a dataset
213 0