That’s most likely because the gallery images are resized on the fly and optimized by Jetpack’s Photon module. By default, Photon will compress your images a bit (image quality is 90% of the original image), but you can change that default setting to 100%, by adding the following code to your theme’s functions.php file, or in a functionality plugin:
add_filter('jetpack_photon_pre_args', 'jetpackme_custom_photon_compression' );
function jetpackme_custom_photon_compression( $args ) {
$args['quality'] = 100;
$args['strip'] = 'all';
return $args;
}
Thread Starter
zomuse
(@zomuse)
Thanks for the reply.
Photon compression does seem to be the cause, but adding that code did not change anything, whether the Photon module was activated or not…
adding that code did not change anything
I must admit that I don’t notice the difference between the 2 images anymore. I opened both of them in separate windows in Google Chrome, on a Retina Macbook, and I didn’t notice any difference in quality when switching from one image to the other:
https://cloudup.com/cGxEN1b8K_o
Could you run a similar test, and let me know what you find? If you see some differences, could you let me know which browser you use, on which machine, and with what Operating system?
Thanks!
whether the Photon module was activated or not…
Photon is automatically used in the galleries as soon as you pick one of the Tiled Gallery types. That’s what allows the images to be resized on the fly to create the tiled effect.
Thread Starter
zomuse
(@zomuse)
Ah, the resized tile image source is different for me.
If I right click/open in the new tab I get http://i0.wp.com/zoehu.co/wp-content/uploads/indulgism6.jpg?resize=653%2C434&quality=100&strip=all
I’m running OS X 10.10.5 on a non-retina 2012 Macbook and I’m using Google Chrome.
Thanks. I get the same URL, but wanted to compare 2 images that had the same size to be able to see the differences a bit better.
Could you go to Settings > Media in your dashboard, and see if your WordPress installation offers resized images that we could compare to this 653x434px image generated by Photon? You can then add the size parameters to your original image URL, like so:
http://zoehu.co/wp-content/uploads/indulgism6-653×434.jpg
Thanks!
Thread Starter
zomuse
(@zomuse)
The medium resize is too small http://zoehu.co/wp-content/uploads/indulgism6-300×200.jpg
and the large resize is too big http://zoehu.co/wp-content/uploads/indulgism6-1024×682.jpg
but it’s clear to me that they retain the colour of the original image.
That helps, thanks! It allows us to build a Photon image using the same size parameters:
http://zoehu.co/wp-content/uploads/indulgism6-1024×682.jpg
https://i0.wp.com/zoehu.co/wp-content/uploads/indulgism6.jpg?resize=1024%2C682&quality=100&strip=all
I clearly see the difference now:
https://cloudup.com/cqF1FbAos64
I’ll ask one of our Photon experts to take a closer look, and see we lose saturation like this.
I’ll get back to you as soon as I have news!
It seems that your galleries include an additional Photon parameter, strip=all, that removes JPEG image Exif, IPTC, comment, and color data from the output image. It helps reducing the image file size, but it can also affect the image quality, as color profiles are removed as well.
You can read more about it here:
https://developer.wordpress.com/docs/photon/api/#strip
Do you use an extra plugin to add this parameter? If so, could you try to deactivate it, and let me know if it helps?
Thanks!
Thread Starter
zomuse
(@zomuse)
I removed
$args['strip'] = 'all';
from the code you gave me at the start and it solved the problem.
Thanks!