Back in the early days, a Sketch designer typically had to export uncompressed PNG or JPG images from Sketch and then choose a means for compressing those files (if desired) using a 3rd party utility. This approach can add to the cumulative production time spent by a designer, particularly if you have lots of images or tend to iteratively revise those images.
About a year ago, Bohemian Coding released two important Sketch plugins that allowed for compression to be applied to both Raster and SVG images upon export – no additional workflow steps required! These were Sketch (Raster) Image Compressor Plugin and SVGO Compressor Plugin.
Well, it’s summer of 2017 and a new ImageOptim Plugin is available. This gives users a new option for automatic PNG and JPG compression upon image export from Sketch.
It’s Not Just About Compression
There are too many variables to allow for an easy one-size-fits all test to declare a winner between theses two raster compression plugins. So instead, here are some highlights of each. Trying them both with your own designs, and see which combination of workflow and compression results suit your working style.
Regardless of which one you choose, it’s a useful practice to compress your exported raster files somehow.
Sketch Image Compressor Plugin
Using the Sketch Image Compressor Plugin is definitely a more seamless experience. Once installed, it offers an option that requires no special action (i.e. it just works when exporting vs requiring you to trigger it from the /Plugins menu). It applies “Quick Compression” when you export one or more assets using the export button in the lower right of the Sketch UI. This option lives up to its name, and quickly produces noticeably compressed images.
If you want to get the smallest possible file size from this plugin or “Full Compression” (aka slower process), that does require you to choose Plugins › Sketch Image Compressor › Export.
Because of these two options, and the fact that it only requires a plugin and no other installed application, this is probably the simplest and easiest option for everyday use.
If you are already a fan of the ImageOptim Mac app, then this plugin will make you very happy. The plugin requires that you have the Mac app installed. However, it saves you lots of time by integrating with Sketch and sending assets directly into the ImageOptim Mac app (no need to export files to your drive and then manually run them thru the app).
The plugin will open ImageOptim automatically when you export individually selected assets. You can also export all assets via the Plugins menu. There’s no concept of ‘Quick’ or ‘Full’ compression within the plugin itself, because you must configure the supporting ImageOptim Mac app with your desired compression settings (set and forget or fine tune each time). Depending on how you configure the app, your compression speed and file sizes will vary. If you invest the time in understanding the app, it seems likely that you could squeeze out smaller file sizes than what Sketch’s plugin produces.
Overall the process can feel less streamlined and slower, because it involves launching the ImageOptim Mac app do it’s job.
ImageOptim isn’t just about optimization, it’s about options. If you really want complete control over your compression settings and results, then you may prefer using the ImageOptim plugin – despite the additional steps in the overall UX.
Seeing as Bohemian Coding’s plugin is still marked BETA perhaps they’ll just bake compression options right into a future version of Sketch, ahem.
If I can losslessly compress a PNG produced by Sketch and produce a much smaller file, why doesn’t Sketch do it by default?
— Max Shelley (@maxshelley) August 10, 2016