Six Colors
Six Colors

This Week's Sponsor

Magic Lasso Adblock: YouTube ad blocker for Safari


By Jason Snell

Get images in better formats with Hazel

I came late to Hazel, Noodlesoft’s $42 utility that can act automatically on folders on your Mac to perform all sorts of tasks automatically. It was a desire to automatically compress old podcast projects that finally pushed me over the edge, but now that Hazel is a tool in my Mac toolchest, I keep finding other uses for it.

(Last year I wrote about how I use Hazel to automate the conversion of iCal files downloaded from the Southwest Airlines website. Funny story—I haven’t flown anywhere since then!)

Lately, I’ve been running into an increasing number of websites that are serving up image files in Google’s WebP format. These display properly in my browser, but some apps I use do not like WebP images at all, and either don’t accept them or refuse to display them.

Personally, I prefer good ol’ JPEG files. Preview will open a WebP image and export it out as a JPEG, but it’s work I’d rather not do. Which is when it occured to me: This looks like a job for Hazel!

Most commonly these WebP images are ones I’ve dragged out of Safari and onto my Desktop for use in a post in Slack, which doesn’t properly display them. So I can set up Hazel to look on the Desktop for WebP files:

Hazel window

Hazel doesn’t have a library of image commands, so I’m going to need to convert the file using another tool. While I could whip up a script to do this, I don’t have to—one of Hazel’s options is to run an Automator workflow on whatever file matches is criteria.

So I opened up Automator and create this galaxy-brain Automator workflow:

Automator

Yep, it’s one step. “Change type of image to JPEG.”

That’s it. That’s the whole thing. Now when I drag a .webp file onto my Desktop, within a couple of seconds it’s transformed into a JPEG instead, ready for insertion wherever I want it to go.


Search Six Colors