Open mrcsmcln opened 8 years ago
Hi @mrcsmcln
Could you please try to reproduce that behavior by underlying sharp
library.
Also it would be really helpful to have system info: nodejs, OS, sharp, libvips versions.
I cannot reproduce this issue with sharp
because while it is not the best at compressing (presumably for the benefit of speed), it does produce images of smaller filesizes.
Using sharp-cli
with an input image 1.png
of 567028 bytes, sharp --compressionLevel 9 1.png > 2.png
produces 2.png
, an output image of 483392 bytes. Not much of a difference, but still less than what we started with.
On the other hand, running gulp-responsive
with the following options…
$.responsive({
'**/*.png': [{}]
}, {
quality: 100,
progressive: true,
compressionLevel: 9,
errorOnUnusedConfig: false,
errorOnUnusedImage: false,
errorOnEnlargement: false
})
…produces an image that is 694747 bytes.
Not sure what's going on. Here's my system info:
MacBook Pro (Retina, Mid 2012) Mac OS X 10.11.3 Node.js: 5.6.0 sharp: 0.13.1 libvips: 8.2.2
Hi @mrcsmcln
To have the same results as produced by sharp-cli
and sharp
itself you should set progressive
to false
.
Could you please share your example image?
I don't have the same exact image I used, but it was very similar to this one:
Any idea why progressive
should be set to false
to achieve the same results?
The same problem: #40
@lovell Could you please help me with this issue? Thanks!
It's worth experimenting with withoutAdaptiveFiltering for images with large areas containing the same pixel values (this is partly how pngcrush works).
@lovell Thank you!
The 'withoutAdaptiveFiltering ' is now deprecated. Any other tip? Thx.
Hi @serneelsalexis , option withoutAdaptiveFiltering
is deprecated but still valid.
Next major release of gulp-responsive
will be synchronized with the new sharp
api and options.
@mahnunchik when will this be ready? I like almost everything about this package but the compressed filesize is indeed almost twice the size of my source images.
@mahnunchik setting the withoutAdaptiveFiltering
option to true did exactly what I needed. Thx
Even with
compressionLevel: 9
, my PNGs are actually getting larger. Any way to ameliorate this?