Instantly share code, notes, and snippets.

What would you like to do?

Sketch Image Compressor (Beta)

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 : )


  • Download Sketch Image Compressor & unzip it.
  • Double click Sketch Image Compressor.sketchplugin to install the Plugin.


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 and jpegoptim using the quickest settings for both, so that you get smaller files as fast as possible. This method does not require you to do anything, just export as you do normally, and your files will now be smaller. Please note that assets exported by dragging from the Layer List or the Inspector preview area won't be compressed.
  • 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, pngout, zopflipng, jpegtran and jpegoptim, using more aggressive settings than the Quick Compression (i.e: the operation will be extremely slow)

Please note that both methods won't block Sketch's UI when running, so you'll be able to keep on working while the compressors run. However, running a Full Compression on a non-trivial document will most likely consume a lot of CPU for a long time, so don't expect Sketch to be as snappy as usual : )

You'll get some feedback about the process while it's running in the Sketch window, and a few stats when it is done.

Support & Feedback

If you find any issue or have any suggestion, please hit me at and I'll be happy to help : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment