Reduce File Size in Sketch.app

ronald-yang-21762-unsplash-reduced@4x
Image comparison after Reduce File Size, then exported at 4x

When designing with high-quality images, Sketch files can get HUGE.

Sketch stores all image assets in the sketch file, so every placed image increases the Sketch file’s size on disk. Additionally, images are stored using lossless compression, which is not nearly as efficient as JPEG, so placed images may take up 5x more disk space than their originals. (this seems kind of dumb, why not just store the originals, in their original format?) Sketch files are otherwise zip-compressed, so aside from placed images, they should be very small.

Sketch has a Reduce File Size option in the File menu, but it’s not perfect. The danger, besides being irreversible, is that images seem to scale to 1x their largest placed size. This means @2x or @3x exports will scale up and image quality will be degraded and mushy. Likewise, if an image needs to be scaled up as part of a design revision, image data won’t be available to do so cleanly.

An easy workaround is to convert all placed images to symbols — then to scale down the image-symbol instance. This lets us set reasonable maximum sizes (eg. 2000px instead of 8000px) and use Reduce File Size without compromising image quality.

Photo by Ronald Yang on Unsplash

Quantity Queries for CSS

This was just awesome: Things get interesting when concatenating :nth-last-child(6) with :first-child, introducing a second condition. In this case, I am looking for any element that is both the sixth element from the end and the first element. Selects a members of a set if that set contains exactly six objects. Mind blown. Quantity Queries […]

Em-based relative breakpoints

Designing with relative breakpoints (no pixels widths!) Crazy, but the thinking is sound: 7 Habits of Highly Effective Media Queries

The next version of Bootstrap is switching to Em-defined breakpoint widths. http://v4-alpha.getbootstrap.com/layout/overview/#responsive-breakpoints

Update: The Bootstrap team reversed course, v4 will use px breakpoints. Discussions on GitHub: #17366#17403 (and way back in 2012: #1943)

While I suspect pixels will win out, the debate goes on. PX, EM or REM Media Queries?