Optimizing Images With TinyPNG and Workflow

Whenever I include images or screenshots within the body of a blog post, I resize them so they aren’t unnecessarily large. iPad Pro screenshots, for instance, are 2732x2048px and often larger than 1MB. There’s no need to share these images full-size, so I reduce their dimensions to something like 1024x960px. This usually gets the file size down to around 200KB.

Back when I used a Mac to write blog posts, I would have also taken the step of optimizing the images using ImageOptim. This app uses clever compression techniques to reduce the file size while preserving quality. It was a simple drag-and-drop process that could drastically reduce the file size further. I haven’t yet found an equivalent iOS app that does something similar, so image optimization isn’t something I’ve been doing.

However, there are web services that perform image optimization. One such service, TinyPNG, has an API that can receive images and return a URL to an optimized version. Using Workflow’s recent API support, I’ve created this workflow that both resizes and optimizes JPG or PNG images using the TinyPNG API. When the action extension workflow is run, there’s an option to resize the image (using Workflow’s built-in image resize action), after which it’s uploaded to TinyPNG for optimization. An alert displays the difference in file size before the optimized image is downloaded. TinyPNG uses randomly-generated filenames, so you’re asked by the workflow to specify a new one.

The following PNG screenshot, resized to 1024x960px, was originally 202KB. After optimization, it’s just 57KB.

TinyPNG is free to use if you’re optimizing up to 500 images per month, which is plenty for most bloggers. As with most API services, you need an API key to use TinyPNG (the workflow has an import question that prompts for this).

Before you start optimizing images, keep in mind that TinyPNG is a web service and you’re uploading images to a third-party. It’s entirely up to you about what images you feel comfortable optimizing. I’m happy to use this for any public images and screenshots I’d share on my blog anyway, though I wouldn’t use it to optimize images that contain sensitive information (scans of passports, screenshots of bank account details, etc.).

Working Copy on Sale →

One of my favorite and most frequently used iOS apps is currently 25% off for a limited time. If you want to make use of Git on your iPhone or iPad, you need this app (I manage this website using Working Copy and GitHub).

Domain Redirection Using DNSimple

Until 2015, my blog was at sparsebundle.net. I eventually decided to change where my blog was located, so I moved it over to jordanmerrick.com, making sure to keep the URL structure the same.

I used to host jordanmerrick.com on a fairly standard web server at DigitalOcean. This server had an additional host configured for the sparsebundle.net domain which simply redirected any sparsebundle.net links to the equivalent jordanmerrick.com version. Nowadays, I use a git-based workflow and host the site with Netlify, so redirecting sparsebundle.net links is done differently.

I use DNSimple to manage the DNS records of my domains. The service offers a useful URL record that redirect entire domains from one to another while retaining the URL path. Anyone trying to find an old sparsebundle.net blog post are redirected to the post located here. It’s a really simple solution to something that is often more complex than it feels it needs to be.

The redirect functionality doesn’t work to, or from, HTTPS URLs, though sparsebundle.net never used SSL in the first place. Although jordanmerrick.com does use SSL, any non-HTTPS links are gracefully redirected to HTTPS by Netlify.

Workflow Introduces Magic Variables →

Federico Viticci:

With today’s 1.7 update, the Workflow team isn’t introducing Instant Variables. Instead, they’ve rebuilt the engine behind variables on a new system called Magic Variables, which completely reimagines how you can create workflows and connect actions for even more powerful automations.

More than a mere tweak for power users, Magic Variables are the next step in Workflow’s goal to enable everyone to automate their iOS devices. By making workflows easier to create and read, Magic Variables are the app’s most important transformation to date, and the result far exceeds my expectations.

Federico isn’t exaggerating when he says this is a significant update to Workflow. Magic Variables fundamentally changes how workflows are created, making them both easier to build and much more powerful.

Quickly Access Authenticator Codes in 1Password on Your Apple Watch →

A useful tip I’ve published at tapCompendium for Apple Watch users who might be using 1Password for two-factor verification:

Many online services offer two-factor authentication (also known as two-step verification) as an additional layer of security that helps protects your account. 1Password can be used as an authenticator app that generates six-digit codes for services that make use of one-time passwords.

Instead of opening or switching to 1Password on your iPhone or iPad whenever you need a verification code, the 1Password app for Apple Watch keeps them within easy reach.

There are some hidden gems when it comes to Apple Watch apps, and the 1Password app is one I find invaluable. It’s great to have my verification codes to hand (or wrist) as there are a number of steps to doing this within the 1Password iOS app.