Website optimization: how to speed up your website
You can effectively optimize and speed up your website by minimizing gif and png images. Are the images slowing down your website and cause you ineffective business? As a rule, images comprise 50% of the average web page, therefore it would be a sensible idea to put them on a diet to improve website performance. And the most effective way to optimize the images is to minimize the “bit-depth” (the number of colours within your images).
Palette-based GIF and PNG images have tied to the size of the colour palette. If there are more than two colours in the image, the file size immensely jumps. A 33-colour image will use a six-bit palette while a 32-colour image can use only a five-bit image. Therefore, on minimizing the number of colours in the gifs and pngs you will minimize file size as well.
The schemes that are recommended for website optimization should be dictionary-based encoding algorithms. Those algorithms use shorter codes for longer patterns. All substrings found in the data stream are replaced with a single code. If there’s no such substring in the dictionary, a new code is usually created and added to the dictionary. Compression can be done when smaller codes are used for longer patterns.
The code sizes are based on the number of bits per pixel and they depend on the maximum length of the code. Therefore, if you want to minimize the size of your file, you need to minimize the bit-depth.
The first step in optimizing your images is to choose the right format. In case banding appears in smooth-toned images, quantize your image to different palettes.
PNG images use deflate compression algorithm which appears to be more effective than its “relative” Lempel-Ziv-Welch (LZW). If we compared deflate compression and LZW, you would see that deflate algorithm compresses images 20 to 30 per cent smaller than LZW. On a whole, the smaller the colour palette, the smaller the overall file size will be.
Summing up all the information said before, if you’re interested in minimizing the file size of image formats such as gif and png, minimize the number of colours and maximize the flat-areas.