There is no 'best' way to universally compress images, because the best compression method will vary for each individual image.
Broadly speaking, for web images:
- is it a photo? Use JPG compression.
- is it flat art? Use PNG compression.
- can you use an SVG instead? Do that.
But as for which JPG compression tool to use or which PNG compression tool to use, there is on 'best' as each tool will be better for particular images than another may be.
That's why tools like ImageOptim use several compression methods. They take your image, run it through each one individually, and then figure out which produces the smallest image. But to figure that out, it has to go through the process of trial-and-error for every single image.
Other options to consider:
- for your icons, be sure to use sprite files. One sprite file is typically smaller in file size than many individual files. Plus, there only needs to be one HTTP request--which is your biggest savings in download speeds.
- large background images and large photos can often be highly compressed via JPG and still look decent. As they are background images, they likely don't need to be as sharp anyways.
- SVG (vector images) are typically the smallest file size. Use these when you can. Alas, not all browsers support them yet.