Compression + Optimising

Lossless and lossy compression are terms that describe whether or not, in the compression of a file, all original data can be recovered when the file is uncompressed. With lossless data all of the original information remains after the file is uncompressed. However on the other hand, lossy compression reduces a file by permanently removing certain information, especially information you no longer need. Lossy compression is generally used for video and sound, where a certain amount of information loss will not be detected by the majority.

Advantages of lossy compression: It compresses the file and gets rid of any unnecessary data which you no longer need, therefore making the file smaller and saving space.

Disadvantages of lossy compression: A negative effect of  the compression removing certain data is that you cannot retrieve that data if you need to. Videos and images may slightly become pixellated  or distorted due to this loss of data but it is very rarely noticeable.

Advantages of lossless compression: When it compresses the file it keeps all the data, which stops any unwanted distortion or pixellation.

Disadvantages of lossless compression: Keeping all the data means that the compressed file will be larger than a lossy compressed file.

The compression method for a JPEG is usually lossy, meaning that some original image information is lost and cannot be restored which can possibly affect the image quality. There is an optional lossless mode defined in the JPEG standard, however, that mode is not widely supported in products.

Optimising images for the web is quite tricky. You have to get the right balance between file size and picture quality. Look at a webpage, and you will see that the majority of load time comes from images. Your website will be annoyingly slow if you don’t drop the sizes of these images. There are three key areas where bytes can be shaved off your graphics: bit depth (number of colours), resolution, and dimension.

Here is an example of the differences in compressing your image into different types of formats.

Leave a comment