Jump to content
thirty bees forum

Gz compress images


Havouza

Recommended Posts

Pictures are already compressed (exception: some vintage formats like BMP). Compressing them twice can make them actually larger:

sh $ ll test.png -rw-r--r-- 1 user user 2879672 Mai 13 11:08 test.png $ gzip test.png $ ll test.png.gz -rw-r--r-- 1 user user 2880128 Mai 13 11:08 test.png.gz

Link to comment
Share on other sites

It might be that the images on your pages could use a "lower" JPEG image quality setting without much if any impact on the resulting image quality. Google talks about this a bit here: https://developers.google.com/speed/docs/insights/OptimizeImages

Edit: Looking at the site linked in your signature I don't think there are any gains to be made from additional compression. There is already jpeg artifacting in the images I looked at, and they aren't excessively large images or anything like that either. Maybe the recommendation was for a few specific images on your site?

Link to comment
Share on other sites

I think my edit was too late to be seen before you replied, @Havouza.

I had a look at the images on your site and they are already very compressed. Perhaps over compressed as there is quite a lot of jpeg artifacting in some of them. (I know this isn't your choice as you get the images from your supplier.)

In the future (for a different site, perhaps) if you do need to re-compress images in batches you can automate this with a simple script for ImageMagick. I automate the resizing and watermarking of all my images with ImageMagick and once it's set up it's such a huge time saver.

Link to comment
Share on other sites

I will make you do that for the next one ;-) The uppload from supplier comes as a zip which I download and uszip using a cron every Saturday. The import module then pick them there. In the db I have the full URL and the developer explained that the images get resized when called first time

Link to comment
Share on other sites

@Havouza said in Gz compress images:

Insight claim my png should be 77% smaller

I missed this message earlier somehow, and what they say is very possible.

PNG is a lossless image file format. It has very good compression but without using special trickery the files will always be much larger than JPG files with similar image quality. If you find those PNG files and convert them to JPG they will be much smaller.

Link to comment
Share on other sites

[PNG] has very good compression but without using special trickery the files will always be much larger than JPG files with similar image quality.

Depends a lot on the type of image. For photographs, JPEGs are typically smaller, that's true. Graphics with sharp boundaries and larger areas of the exactly same color, e.g. a page of text or screenshots, compress a lot better with PNG.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...