How to use the gulp-imagemin.optipng function in gulp-imagemin

To help you get started, we’ve selected a few gulp-imagemin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rackerlabs / table-builder / gulpfile.js View on Github external
const imgTask = function buildImages() {
  return gulp.src('src/images/**/*')
   .pipe(imagemin([
     imagemin.optipng({ optimizationLevel: 5 }),
   ]))
   .pipe(gulp.dest('dist/images'))
   .on('end', () => {
     console.log('Successfully compressed images');
   });
};
github theme-my-login / theme-my-login / gulpfile.js View on Github external
function images() {
	return gulp.src([
		'src/assets/images/**/*'
	])
	.pipe(gulpImagemin([
		gulpImagemin.gifsicle({interlaced: true}),
		gulpImagemin.mozjpeg({quality: 75, progressive: true}),
		gulpImagemin.optipng({optimizationLevel: 5}),
		gulpImagemin.svgo({
			plugins: [
				{removeViewBox: true},
				{cleanupIDs: false}
			]
		})
	]))
	.pipe(gulp.dest('build/assets/images'));
}
github LiskHQ / lisk-docs / gulp.d / tasks / build.js View on Github external
next(null, file)
            })
          }
        })
      )
      .pipe(buffer())
      .pipe(uglify()),
    vfs.src('css/site.css', { ...opts, sourcemaps }).pipe(postcss(postcssPlugins)),
    vfs.src('font/*.{ttf,woff*(2)}', opts),
    vfs
      .src('img/**/*.{gif,ico,jpg,png,svg}', opts)
      .pipe(
        imagemin([
          imagemin.gifsicle() || imagemin.noop,
          imagemin.jpegtran() || imagemin.noop,
          imagemin.optipng() || imagemin.noop,
          imagemin.svgo({ plugins: [{ removeViewBox: false }] }),
        ])
      ),
    vfs.src('helpers/*.js', opts),
    vfs.src('layouts/*.hbs', opts),
    vfs.src('partials/*.hbs', opts)
  ).pipe(vfs.dest(dest, { sourcemaps: sourcemaps && '.' }))
}
github thedaviddias / Front-End-Design-Checklist / gulpfile.babel.js View on Github external
gulp.task('compress-images', ['compress-webp'], () => {
  return gulp.src(dirs.src + '/img/**/*.{jpg,png,svg}')
    .pipe(imagemin([
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5})
    ]))
    .pipe(gulp.dest(dirs.dest + '/img/'));
});
github escueladigital / EDboilerplate / gulpfile.babel.js View on Github external
gulp.task('images-build', () => {
  gulp.src('./src/img/**/**')
    .pipe(imagemin([
      imagemin.gifsicle({interlaced: true}),
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
      imagemin.svgo()
    ]))
    .pipe(gulp.dest('./public/assets/img'))
})
github MinnPost / object-sync-for-salesforce / Gulpfile.js View on Github external
function images() {
  return gulp.src(config.images.docs_src)
    .pipe(
      imagemin([
        imagemin.gifsicle({ interlaced: true }),
        imagemin.jpegtran({ progressive: true }),
        imagemin.optipng({ optimizationLevel: 5 }),
        imagemin.svgo({
          plugins: [
            {
              removeViewBox: false,
              collapseGroups: true
            }
          ]
        })
      ])
    )
    .pipe(gulp.dest(config.images.docs_dest));
}
github rehabstudio / fe-skeleton / run / tasks / images / index.js View on Github external
gulp.task('images', function() {
    return gulp.src(options.sourcePaths, {base: './'})
                .pipe(imagemin([
                    imagemin.gifsicle(options.imageminPlugins.gifsicle),
                    imagemin.jpegtran(options.imageminPlugins.jpegtran),
                    imagemin.optipng(options.imageminPlugins.optipng),
                    imagemin.svgo(options.imageminPlugins.svgo)
                ]))
                .pipe(gulp.dest(globalSettings.destPath));
});
github phodal / new-project-checklist / web / gulpfile.babel.js View on Github external
gulp.task('compress-images', ['compress-webp'], () => {
  return gulp.src(dirs.src + '/img/**/*.{jpg,png,svg}')
    .pipe(imagemin([
      imagemin.jpegtran({progressive: true}),
      imagemin.optipng({optimizationLevel: 5}),
    ]))
    .pipe(gulp.dest(dirs.dest + '/img/'));
});
github codingphasedotcom / hyperapp-starterkit / gulpfile.js View on Github external
gulp.series(function minizingImages() {
		return gulp
			.src('assets/img/**/*')
			.pipe(
				imagemin([
					imagemin.gifsicle({ interlaced: true }),
					imagemin.jpegtran({ progressive: true }),
					imagemin.optipng({ optimizationLevel: 5 }),
					imagemin.svgo({
						plugins: [{ removeViewBox: true }, { cleanupIDs: false }]
					})
				])
			)
			.pipe(gulp.dest('./public/img'));
	})
);
github colinrotherham / core / src / tasks / img / optimise.js View on Github external
export default (config, gulp) => {

  const options = config.options || [
    imagemin.gifsicle(),
    imagemin.jpegtran({
      progressive: true,
    }),
    imagemin.optipng(),
    imagemin.svgo({
      plugins: [{
        removeViewBox: false,
      }],
    }),
  ];

  return () => gulp.src(config.src, { dot: true })
    .pipe(imagemin(options))
    .pipe(gulp.dest(config.dest));
};

gulp-imagemin

Minify PNG, JPEG, GIF and SVG images

MIT
Latest version published 6 months ago

Package Health Score

66 / 100
Full package analysis