Image Optimisation Tool using Golang: imagecomp
ImageOptim is a great image compression tool, however, it doesn't compress image as optimal as possible. Hence, we decided to build our own image compression tool in Golang: imagecomp.
imagecomp depends on
mozjpeg to be installed. For the dependency installation, follow this instructions.
To compress all images in a given directory, just run:
It has other advanced features as well such as including or excluding certain folders from being optimized using wildcard character
*. For example:
imagecomp . -exclude public/assets/* -include public/assets/users/*
Note that the order of
-include option matters.
We've been using imagecomp for image optimization task with great satisfaction at Dexcode and we're pleased to share this tool with other developers. If you have any feedback, problems, or suggestions don't hesitate to open an issue at Github.