Display high resolution images at correct scale

Use case or problem

When viewing high resolutions image attachments, Obsidian displays them very large.

Proposed solution

If attachments contain “@2x”, “@1.5x” etc in their filename, Obsidian should adjust for the multiplier when displaying them.

Current workaround

Open image in another app to check the total pixels, then calculate the display size, adjust image display size in Obsidian by adding |nnn at the end of the link.

Related feature requests

I couldn’t find a similar request, but did find some documentation here about Electron and high resolution images.

1 Like

At the moment I am working around this by defining a css class in front matter:

---
cssclass: RetinaImages
---

with the following snippet applying a zoom value to all images in that note:

.RetinaImages img {
  zoom: 0.5;
}​

This works okay as long as the note only contains images are 2x scale.

But it would be so nice if there was a way Obsidian could parse the filename and apply an appropriate zoom value wherever it finds “@2x” or “@1.5x” etc

1 Like