How to use imagemin-pngquant - 10 common examples

To help you get started, we’ve selected a few imagemin-pngquant 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 getPngPlugins(quality) {

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

  if (quality === "perfect") {
    return [imageminPngquant({
      quality: 100
    })];
  }

  if (quality === "ultra") {
    return [imageminPngquant({
      quality: 90
    })];
  }

  if (quality === "high") {
    return [imageminPngquant({
      quality: 80
    })];
  }
github motivast / motimize / src / services / optimize.js View on Github external
}

  if (quality === "high") {
    return [imageminPngquant({
      quality: 80
    })];
  }

  if (quality === "medium") {
    return [imageminPngquant({
      quality: 70
    })];
  }

  if (quality === "low") {
    return [imageminPngquant({
      quality: 60
    })];
  }

  // If we get here this means quality do not match any of our conditions which
  // should not happen.
  throwNotFoundQualityError();
}
github motivast / motimize / src / services / optimize.js View on Github external
if (/^([0-9][0-9]?|100)$/.test(quality)) {
    return [
      imageminPngquant({
        quality: quality
      })
    ];
  }

  if (quality === "perfect") {
    return [imageminPngquant({
      quality: 100
    })];
  }

  if (quality === "ultra") {
    return [imageminPngquant({
      quality: 90
    })];
  }

  if (quality === "high") {
    return [imageminPngquant({
      quality: 80
    })];
  }

  if (quality === "medium") {
    return [imageminPngquant({
      quality: 70
    })];
  }
github DanWebb / jdown / src / transform-assets.ts View on Github external
const assets = paths.map(async assetPath => {
    const asset = await imagemin([assetPath], '', {
      plugins: [
        imageminPngquant(options.png),
        imageminJpegtran(options.jpg),
        imageminGifsicle(options.gif),
        imageminSvgo(options.svg)
      ]
    });
    asset[0].path = assetPath;
    return asset[0];
  });
github chalkygames123 / front-end-template / gulpfile.esm.js / tasks / images.js View on Github external
}),
          $.imagemin.jpegtran(),
          $.imagemin.svgo({
            plugins: [
              {
                removeUselessDefs: false
              },
              {
                removeViewBox: false
              },
              {
                cleanupIDs: false
              }
            ]
          }),
          imageminPngquant()
        ])
      )
    )
    .pipe(utils.detectConflict())
    .pipe(gulp.dest(`${config.get('distDir')}/${config.get('baseDir')}`))
    .pipe($.if(config.get('webp'), $.filter('**/*.+(png|jp?(e)g)')))
    .pipe(
      $.if(
        config.get('webp') && !isDev,
        $.imagemin([
          imageminWebp({
            quality: '90',
            method: 6
          })
        ])
      )
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 chalkygames123 / front-end-template / gulpfile.js / tasks / images.js View on Github external
$.imagemin.gifsicle({
        optimizationLevel: 3
      }),
      $.imagemin.jpegtran({
        progressive: true
      }),
      $.imagemin.svgo({
        plugins: [{
          removeUselessDefs: false
        }, {
          removeViewBox: false
        }, {
          cleanupIDs: false
        }]
      }),
      imageminPngquant({
        quality: '80-90',
        speed: 1
      })
    ])))
    .pipe(utils.detectConflict())
    .pipe(gulp.dest(upath.join(config.distDir, config.basePath)))
    .pipe($.if(config.webp, $.filter('**/*.+(png|jp?(e)g)')))
    .pipe($.if(config.webp && !isDev, $.imagemin([
      imageminWebp({
        quality: '90',
        method: 6
      })
    ])))
    .pipe($.if(config.webp, $.rename({
      extname: '.webp'
    })))
github dmnsgn / frontend-boilerplate / boilerplate / tasks / images.js View on Github external
export function optimizeImages() {
  return gulp.src([`${config.src}/images/**/*`, `!${config.src}/images/{sprite,sprite/**}`])
    .pipe(newer(`${config.dist}/images`))
    .pipe(cache(imagemin({
      progressive: true,
      interlaced: true,
      use: [pngquant()]
    })))
    .pipe(gulp.dest(`${config.dist}/images`));
}
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 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);
}

imagemin-pngquant

Imagemin plugin for `pngquant`

MIT
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis

Popular imagemin-pngquant functions