M
M
mUchenik2017-09-21 08:58:10
linux
mUchenik, 2017-09-21 08:58:10

How to compress *.png in linux?

All the best!
Tell me, dear experts, with what command can you compress all png images using the OPTIPNG utility in a folder and all subfolders?
Without changing the height and width of the images.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stepan Krapivin, 2017-09-21
@mUchenik

find . -name "*png" |xargs optipng

A
Alexander Reshetnyak, 2017-09-21
@Vampireos

npm install gulp-pngquant
in gulpfile.js

var gulpPngquant = require('gulp-pngquant');

gulp.task("default", function() {
return gulp.start('image');
});

gulp.task('image', function() {
gulp.src('путь до папки/*.png')
.pipe(gulpPngquant({
quality: '65-80'
}))
.pipe(gulp.dest('путь до папки'));
});

https://pngquant.org/
https://www.npmjs.com/package/gulp-pngquant/

V
Vladimir Mukovoz, 2017-09-21
@castomi

It's easy to search in Google
https://losst.ru/szhatie-png-v-linux
Have you looked?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question