JPEG & # 8594; more compressed JPEG - is it worth it?

I am working on a website that includes displaying tons of product images from various online stores. Since most of the page weight is in the images, I thought it would be worth looking at the methods for fine-tuning the file size.

Images are already JPEG. I know that PNG has a lot of extra cool that can significantly increase the file size, but I have less experience with JPEG. So a couple of questions:

  • Is further JPEG compression possible? It looks like further compression of something that already in the lossy format can lead to more harm (low quality) than good (saving 10 +% of the file size).

  • Are there other methods to reduce file size? I don't know if EXIF ​​metadata or other metadata is part of any of these images, and if cutting them is a significant improvement.

  • Any experience / recommendations on using GD or ImageMagick (or something else?) There is also a commercial image compression library from Spinwave.

+4
source share
5 answers

Do you use thumbnails? If so, are they saved separately or is the enlarged image fully uploaded and simply resized on the web page? Having separate thumbnails the size of which is shown on your pages will save a lot of bandwidth.

You can reduce the quality factor in JPEGs until you see it. When you do this, you will see an improvement in file size. However, as you suspect, since you already have JPEGs, you can see the checkerboard artifacts in the images before because you are compressing already compressed images.

GD or IM work well.

+1
source
  • There are lossless compresions such as .ZIP, but they are usually worse and not very useful for an already compressed format.

  • JPEG can have different compression levels. It is your decision how much quality is enough. Digital camera photography can be compressed to one tenth of its size, perfect for a website.

  • JPEG is better for photos. PNG is better for logos and simple colors.

  • ImageMagick should allow you to resize jpeg from the command line or lib program. See http://www.imagemagick.org/Usage/formats/#jpg

0
source
  • For me, the quality is good until you drop below 75-80% of quality.
  • I don’t think that any metadata (JPEG also supports IPTC) will greatly inflate the file size, but it might be worth doing some custom tests (something on the blog!)
  • I was involved in PHP to love GD (I know one of the authors). Just a remmeber for caching images as files. For instance:

    $ im = imagecreatefromjpeg ('file.jpg');

    // output function

    // 80 = quality

    imagejpeg ($ im, 'savedfile.jpg', 80);

Code formatting does not work!

0
source

My experience shows that some “commodity” images are created with color space metadata for accurate color reproduction on print media. This may increase the size of the jpeg file. In some cases, I was able to reduce jpeg files by about 30% by simply deleting EXIF.

0
source

Do not recode. If you have original images in any lossless format, then encode with a higher compression ratio. If you perform DCT quantization on top of an already DCT quantized image, you will introduce an unnecessary loss of image quality compared to direct encoding with the desired lower bit rate.

0
source

All Articles