A Plugin for Sketch that compresses your bitmap assets, to keep filesize to a minimum.
Please note that the compression is lossless, so no pixels will be harmed by running this Plugin : )
Installation
- Download Sketch Image Compressor & unzip it.
- Double click Sketch Image Compressor.sketchplugin to install the Plugin.
Usage
The Plugin uses two methods for asset compression:- Quick Compression happens automatically, whenever you export an asset from Sketch using the File › Export… menu option or the Export button in the toolbar. The Plugin will run your PNG & JPG assets through
optipng
andjpegoptim
using the quickest settings for both, so that you get smaller files as fast as possible. - Full Compression happens when you choose the Plugins › Sketch Image Compressor › Export All Assets menu option. You'll be asked for a path where your assets will be exported, and then the Plugin will export every exportable layer from your document, and run the assets through
advpng
,optipng
,pngcrush
,zopflipng
,jpegtran
andjpegoptim
, using more aggressive settings than the Quick Compression (i.e: the operation will beextremely slow)
Acknowledgements
- Thank you ImageOptim for the inspiration. If you're looking for more fine-grained control of your compression settings, or a way to do lossy compression, it doesn't get any better than this.
- Thanks to the following projects: