Encoding images, also called compressing, is an algorithm that can reduce the overall image file size but maintain the quality of the image. There are a couple of different methods, lossy and lossless, that need to be considered when compressing images. Lossy compression reduces file size, but at the expense of quality. Lossless compression reduces file size but maintains quality. However, there is no reversing lossy compression. Lossless compression can be reversed. So, if you are looking for a way to reduce image size, but maintain decent image quality, lossless compression is the method of choice. However, with lossy compression, you can reduce the file size down more than lossless compression. There is no real single, clear-cut method. However, for most websites, lossy compression is ideal. For sites that need to display high-resolution images, like photography sites, lossless compression should be utilized.