Open Alexufo opened 4 years ago
You can install imagemin-jpegtran
back and use it instead of mozjpeg.
But keep in mind that JPEG is lossy format by its nature, so there are rare cases when you really need to compress it losslessly. Mozjpeg will get you much better compression ratio
@shrpne I got a HIGHER file size after MOZjpeg. I compress files in Photoshop and put in folder where mozjpeg add useless data on default 75% quality now. It is a grave mistake to change default behavior of lossless compression to lossy just by one pull request. Documentation is wrong now.
I'm sorry that mozjpeg can't reduce filesize after photoshop compression. To get the best results I don't compress images in Photoshop (export with 100%), and use mozjpeg with jpegtran together.
imagemin([
mozjpeg(),
jpegtran({progressive: true}),
])
It will lead to best quality and compression. If you compare photoshop compression with mozjpeg compression, you will notice, that photoshop produce more artifacts with less compression ratio
Also, documentation will be fixed soon #346 :)
MozJpeg has more effective encoder but it less effective if you will set quality by your eyes with PS. In total PS+lossless encode more effective. If you have a lot of images mozjpeg 68% will be good. It much faster for your time. I am waiting when somebody develop algorithm for adaptive encoding when you should not check rate quality/compression by her eyes. In this case mozjpeg with adaptive encoder became as best practice.
Since 7.0.0 jpegtran replaced by mozjpeg. https://github.com/sindresorhus/gulp-imagemin/pull/336
But MozJpeg has only lossy mode. On main page of imagemin:
How I can use MozJpeg in lossless?