How to use imagemin-mozjpeg - 7 common examples

To help you get started, we’ve selected a few imagemin-mozjpeg 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 motivast / motimize / src / services / optimize.js View on Github external
function getJpegPlugins(quality) {

  // If quality is between 0 - 100 use mozjpeg plugin
  if (/^([0-9][0-9]?|100)$/.test(quality)) {
    return [
      imageminMozjpeg({
        quality: quality
      })
    ];
  }

  if (quality === "perfect") {
    return [imageminJpegtran()];
  }

  if (quality === "ultra") {
    return [
      imageminJpegRecompress({
        min: 10,
        max: 95,
        target: 0.999901
      })
github nstungcom / gulp-starter-kit / gulpfile.babel.js View on Github external
function images () {
  return gulp.src(PATHS.images)
    .pipe(gulpif(PRODUCTION,
      imagemin([
        imageminGifsicle({ interlaced: true, optimizationLevel: 3 }),
        imageminMozjpeg({ quality: 80 }),
        imageminPngquant({ quality: [0.5, 0.8] }),
        imagemin.svgo({ plugins: [{ removeViewBox: true }, { cleanupIDs: false }] })
      ])))
    .pipe(gulp.dest(`${PATHS.dist}/assets`))
}
github noth8 / gulp-webpack-boilerplate / gulpfile.babel.js View on Github external
.pipe(gulpIf(isDevelopment, newer(paths.build.imgDir)))
    .pipe(
      gulpIf(
        isProduction && IMAGE_ENCODER_GUETZLI,
        imagemin([
          guetzli({
            quality: IMAGE_COMPRESSION_RATE,
          }),
        ]),
      ),
    )
    .pipe(
      gulpIf(
        isProduction && !IMAGE_ENCODER_GUETZLI,
        imagemin([
          mozjpeg({
            quality: IMAGE_COMPRESSION_RATE,
          }),
        ]),
      ),
    )
    .pipe(gulpIf(isProduction, rev()))
    .pipe(printFileName("CopyImages"))
    .pipe(gulp.dest(paths.build.imgDir))
    .pipe(
      gulpIf(
        isProduction,
        combine(
          rev.manifest("rev-images.json"),
          gulp.dest(paths.build.manifestDir),
        ),
      ),
github atolye15 / web-starter-kit / gulp / tasks / images.js View on Github external
export function imagesOptimize() {
  return gulp
    .src([`${configs.paths.src}/img/**/*`, `!${configs.paths.src}/img/{icons,icons/**}`])
    .pipe(newer('.cache/img'))
    .pipe(
      imagemin([
        imagemin.gifsicle({ interlaced: true }),
        imageminMozjpeg({ progressive: true }),
        imageminPngquant({
          quality: [0.6, 0.8],
        }),
        imagemin.svgo({ plugins: [{ removeDimensions: true }] }),
      ]),
    )
    .pipe(gulp.dest('.cache/img'))
    .on('error', notifierErrorHandler);
}
github acgotaku / YAAW-for-Chrome / gulpfile.babel.js View on Github external
export function images () {
  return gulp.src(paths.images.src)
    .pipe(plumber(config.plumberConfig))
    .pipe(imagemin([
      pngquant(),
      mozjpeg()
    ], {
      verbose: true
    }))
    .pipe(gulp.dest(paths.images.dest))
}
github douglasjunior / emage / app / utils / Process.js View on Github external
const engineJpg = algorithm => {
    switch (algorithm) {
        case 'jpegoptim':
            return imageminJpegoptim({
                progressive: false,
            });
        case 'jpegtran':
            return imageminJpegtran({
                progressive: true,
            });
        case 'mozjpeg':
            return imageminMozjpeg({
                quality: 90,
            });
        default:
            return null;
    }
};
github TrigenSoftware / gulp-srcset / src / generator.js View on Github external
processing = {
		webp: {
			quality: 100
		},
		jpg: {
			quality: 100
		},
		png: {}
	};

	optimization = {
		webp: webpPlugin({
			quality: 100
		}),
		jpg:  mozJpegPlugin({
			quality: 100
		}),
		png:  zopfliPlugin(),
		gif:  gifLossyPlugin(),
		svg:  svgoPlugin()
	};

	postfix = (width, mul) => (mul === 1 ? '' : `@${width}w`);

	skipOptimization = false;

	constructor(config = {}) {

		if (typeof config == 'object') {

			const { processing, optimization, postfix, skipOptimization } = config;

imagemin-mozjpeg

Imagemin plugin for mozjpeg

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis

Popular imagemin-mozjpeg functions