Thomas
Thomas

Reputation: 485

How to set jpeg quality using imagemin-cli?

I am trying to use imagemin to compress images in an npm task. I am able to get the image slightly compressed using:

imagemin src/images/*.jpg -o dist/images --plugin=jpegtran

but I can't find anything in the imagemin-cli docs on how to pass an option to set the amount of compression.

Upvotes: 2

Views: 1889

Answers (1)

Mika Sundland
Mika Sundland

Reputation: 18969

You are using the jpegtran plugin which uses lossless algorithms. That means you can't do much to adjust the compression, as the algorithms behind it are unable reduce the quality of the image.

If you want more compression you have to use lossy compression plugins, such as jpeg-recompress or jpegoptim.

Upvotes: 1

Related Questions