When working with images on web applications and websites optimising images and reducing their download size is a quick win in terms of optimising page and app load times.
There are plenty of image compression utilities out there – both web apps and tools for local installation. Recently, I’ve tried out several of those again because I wanted to reduce the overall load time of this website and according to website audit tools such as Lighthouse image sizes definitely was an area that I could improve upon.
Of those I came across the image compression utility I liked the most, both in terms of outcome and ease-of-use, is Squoosh. Created and maintained by the Chrome team, Squoosh is an open source tool. The source code is available on GitHub.
While there’s a CLI command available, too, the main way of using Squoosh is as a web app.
Squoosh supports JPEG, PNG, and WebP image output formats and various compression algorithms for each of those.