Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Tinypng
Kraken
2 are the best, everyone else is insanely far from them in terms of quality.
Both services have plugins for gulp.
As a completely local option - gulp-image-optimization
RIOT ( luci.criosweb.ro/riot/ ) , quite powerful. I use it myself from time to time, when the customer uploads images of 5 mb each. and asks them to insert on the site. Supports "bulk" compression.
For jpeg - jpegtran
For png, first pngquant and then another PNGZopfli
For batch processing, I coded the script under nodejs (only works under windows)
'use strict';
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
function run(command) {
var pr = exec(command);
//pr.stdout.pipe(process.stdout);
//pr.stderr.pipe(process.stderr);
pr.stdout.on('data', function (data) {
process.stdout.write(data);
});
pr.stderr.on('data', function (data) {
process.stderr.write(data);
});
}
function optImages(files) {
require('mkdirp').sync('raw');
const rawFolder = path.normalize(process.cwd() + '/raw/');
files.forEach(function (file) {
let filePathParts = path.parse(file);
let rawPath = rawFolder + filePathParts.base;
fs.access(rawPath, function (err) {
if (err) {
let format = filePathParts.ext.substr(1);
if (format == 'png') {
run('@COPY "' + file + '" /B "' + rawPath + '" /B >> nul && @pngquant --force --skip-if-large --speed 1 256 --output "' + file + '" "' + rawPath + '" && @PNGZopfli "' + file + '" 10 "' + file + '" && echo complete: "' + file + '"');
} else if (format == 'jpg' || format == 'jpeg' || format == 'jpe' || format == 'jfif') {
run('@COPY "' + file + '" /B "' + rawPath + '" /B >> nul && @jpegtran -copy none -optimize -progressive "' + rawPath + '" "' + file + '" && echo complete: "' + file + '"');
}
}
});
});
}
if (process.argv.length >= 3) {
optImages(process.argv.slice(2));
} else {
glob(process.cwd() + '/@(*.png|*.jpg|*.jpeg|*.jpe|*.jfif)', function (err, files) {
if (err) {
console.error(err);
process.exit(1);
} else {
if (files.length > 0) {
optImages(files);
}
}
});
}
optimizilla.com
Allows you to set the compression quality if you need more than the default
iCatalyst
Optimization without loss of quality, implemented on cmd, supports batch processing.
jpegoptim and optipng for linux. I use them when uploading via nginx so that images are automatically compressed and speedtest from google is satisfied.
Lately I've been using nikkhokkho.sourceforge.net/static.php?page=FileOpt... so far so good.
www.irfanview.com + all plugins
Holds the command line well. Supports bulk conversion.
foboss.livejournal.com/293063.html
#!/bin/bash
apt-get -y install jpegoptim optipng imagemagick
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.jpg" -exec mogrify -verbose -resize '1024x1024>' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.jpg" | xargs -0 jpegoptim --strip-all
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.png" -exec mogrify -verbose -resize '1024x1024 >' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.png" -exec optipng -o5 {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.gif" -exec mogrify -verbose -resize '1024x1024>' {} \; -print
find /srv/www/vhosts/superblog.example.com/public_html/wp-content/uploads/ -type f -name "*.gif" -exec optipng -o5 {} \; -print
For *.jpeg files I use Advanced JPEG Compressor
For *.png files PunnyPNG service
In projects, package for all file types https://www.npmjs.com/package/gulp-imagemin .
One-time - this is the most powerful optimizilla.com , but it is only online and it is not clear what algorithms are there, since the color rendition sometimes deteriorates in images.
One-time for svg https://jakearchibald.github.io/svgomg/ - a dubious pleasure, but visually you can clearly compare the optimization effect.
A non-standard, one-time method for website images: we test the page in google page speed, Google itself will determine which images, scripts can be compressed and give an archive with compressed ones.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question