How to optimise images for Obsidian Publish

(Last updated on 2023-11-21)

Problem:

Obsidian doesn't optimise images out of the box. This site, especially, is full of screenshots or images that don't compress well with PNG. All of this works nicely locally, but can take minutes on slower connections. I want to be kind to my users.

I had some issues with the Image Converter plugin and I'd like to optimise images only selectively. Give Image Converter a go before following my approach.

Solution 1: Convert using ffmpeg

for i in *.png; do ffmpeg -i "$i" "${i%.*}.webp"; done

Solution 2: Batch process with Affinity Photo

Since you're here, you might also want to check out the Alternatives to Adobe.

Want to receive my work as I publish it? Subscribe here.

a giant foot-shaped snail with a house on its back. the house is still in construction, with a big crane towering above it The image is a stylized black-and-white illustration. In the lower left corner, there is a small, cozy-looking house with smoke rising from its chimney. The smoke, however, does not dissipate into the air but instead forms a dark, looming cloud. Within the cloud, the silhouette of a large, menacing face is visible, with its eyes and nose peeking through the darkness. The creature, perhaps a cat, appears to be watching over the house ominously, creating a sense of foreboding or unease.