Automatically compress images on Pull Requests with Github Actions

Calibre launched a new GitHub Action that allows you to compress raster images with minimal setup and automatically run on every pull request. Here is how it works:

The action uses the most efficient, lossless compression libraries—mozjpeg and libvips that work with PNGs and JPGs. What’s excellent about embedding a compression step directly in the developer platform (or CI) rather than in local development environments (or relying on drag-and-drop tools) is that no image can hit production uncompressed. This empowers any contributors with basic knowledge of GitHub to update images without introducing performance regression and saves everyone time.

You can find this action on Github’s Action marketplace and the source code is available too.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.