Page 1 of 1

imagemagick and google page speed

Posted: 2017-01-19T02:18:25-07:00
by eladvider
hi,
suddnely the google page speed tool give me a warings about the compression of my resize images :

"Compressing http: ...ganim.jpg could save 8.4KiB (22% reduction)."

im using imagemagick node with the following options:
{srcPath: file,
format: self._setFormat(),
width: self.options.width,
height: self.options.height + prefix,
strip: true,
interlace: "none",
colorspace: "sRGB",
dither: "none",
quality: 0.75

customArgs: [
'-define', 'jpeg:fancy-upsampling=off',
'-filter', 'Triangle',
'-define', 'filter:support=2',
'-dither', 'None',
'-gravity', 'center',
'-unsharp', '0.25x0.25+8+0.065',
'-interlace', 'none',
'-colorspace', 'sRGB',
'-crop', self.options.width + 'x' + self.options.height + '+0+0',
'+repage'
]
}

Does anyone know how to fix it?

Re: imagemagick and google page speed

Posted: 2017-01-19T03:02:04-07:00
by snibgo
Lowering the quality will increase the compression. However, it will also decrease the quality (make the result more different to the original). I don't know if the google page speed tool cares about quality.

Re: imagemagick and google page speed

Posted: 2017-01-19T04:32:08-07:00
by eladvider
i already lowered the quality(0.75) and google still yelling at me!

Re: imagemagick and google page speed

Posted: 2017-01-19T05:27:27-07:00
by snibgo
Is this a google web page? Do you have a URL?

Re: imagemagick and google page speed

Posted: 2017-01-19T05:53:52-07:00
by Bonzo
You do not need to do what Google tell you; it is your choice. If you are only going to reduce one image by 8.4KiB I would have thought it would make very little difference to load time.

I thought jpg quality was in the range of 1-100.

Re: imagemagick and google page speed

Posted: 2017-01-19T06:45:11-07:00
by eladvider
its about the google page speed score...

the range can be alos 0-1 at least in node imagemagick

Re: imagemagick and google page speed

Posted: 2017-01-19T06:59:09-07:00
by snibgo
JPEGs can always be compressed, if the goal is merely to accelerate download speeds. Here's a 267x233 image I often use, compressed with "-quality 1", a mere 828 bytes:
Image
The quality is totally horrible. It has an RMSE difference of 7.5% from the original. For ordinary photos like this, I accept an RMSE difference of 1%.

Re: imagemagick and google page speed

Posted: 2017-01-19T13:29:05-07:00
by dlemstra
I have also noticed that google page speed has changed. It used to only do lossless compression. What you could try is setting the sampling factor. I think you should do it like this:

Code: Select all

customArgs: [
'-define', 'jpeg:fancy-upsampling=off',
'-define', 'jpeg:sampling-factor=2x2,1x1,1x1',

Re: imagemagick and google page speed

Posted: 2017-01-22T04:59:47-07:00
by eladvider
thanks dlemstra,
it's improve the results but it's not perfect like it was before google changes.

any suggestions?

Re: imagemagick and google page speed

Posted: 2017-01-22T09:34:02-07:00
by dlemstra
You should compare the image with the results from google. There is a download option somewhere on that page. When you compare them with your own images you will see that they are the same.