Compressing and Exporting Photos as .webp in Lightroom Classic

A while back, Google introduced the .webp image format, which allows for superior image compression with less quality loss than the standard JPEG file. And while I’m in no rush to start using .webp on my photography site, 75CentralPhotography.com, I was curious about what kind of space savings it would afford me, so I decided to experiment a bit.

The first problem, and the main topic of this post, is how to get my photos out of Lightroom Classic (hereafter referred to as LrC), which I use to catalog and process my photos, into a .webp format. Unfortunately, LrC doesn’t natively support exporting in this format. Your only choices are:

  • JPEG
  • JPEG XL
  • AVIF
  • PSD
  • TIFF
  • PNG
  • DNG
  • Original

However, there is a clever workaround to export .webp from LrC (in MacOS…can’t help you if you’re on Windows) and I’m going to try to explain it here in a few simple(?) steps.

  1. Install the webp package from Homebrew (https://formulae.brew.sh/formula/webp)
  2. Install exiftool from Homebrew (https://formulae.brew.sh/formula/exiftool) – We need this to preserve image metadata.
  3. Install Jeffery Friedl’s Run Any Command plugin (http://regex.info/blog/lightroom-goodies/run-any-command) – note that Jeffery has his reasons for not using http, so if you’re browser comes up with a “Not Found” error, manually change “https” to “http” in the URL field.
  4. Configure an export preset with JPEG as the output file, adding “Run Any Command” as a Post-Process Action (the bottom left pane on the export screen):

5. Configure the Run Any Command action with this command:
/opt/homebrew/bin/cwebp -q 75 "{FILE}" -o "{NAME}".webp ; /opt/homebrew/bin/exiftool -TagsFromFile "{FILE}" "{NAME}".webp
(The first part before the semicolon does the actual conversion and the second after the semicolon uses Exiftool to copy the metadata from the original to the new webp. You can remove this if you don’t care about metadata.)
6. Export!

What happens, then, during an export is that LrC initially exports a JPEG, but then calls cwebp to convert this file to .webp. Then it calls exiftool to copy the EXIF and ITPC tags from that file to the new webp. This ensures that metadata from the JPEG is present in the .webp, because cwebp doesn’t preserve metadata.

That said, the .webp compression is pretty impressive. Quality loss is minimal, but there are significant space savings, which will lead to faster loading times on the web (and thus increased engagement and SEO). A few examples from some of my recent photos:


North Texas Pond
(Original JPEG size: 2 MB/.webp size: 419 KB)

.webp
.webp
.webp
JPEG
JPEG

The Abandoned Tower
(Original JPEG size: 3.9 MB/.webp size: 695 KB)

.webp
.webp
.webp
JPEG
JPEG

Under the Girders
(Original JPEG size: 2.2 MB/.webp size: 320 KB)

.webp
.webp
.webp
JPEG
JPEG

Questions? Comments? Concerns?