Featherview: a native Mac image viewer in Swift 6 that opens a 4.6 GB PSB in about 2 seconds

Hi everyone,

I’d like to share Featherview, a free, open-source (MIT) image viewer for macOS, written in Swift 6 with strict concurrency, SwiftUI and AppKit.

It’s made for flying through folders with the keyboard: open one picture, then step through the folder with the arrow keys, about 20 ms per image on Apple Silicon. Version 0.13 adds three things that were fun to build in Swift:

  • Huge pictures. Hubble’s 4.6 GB Andromeda PSB (69,536 × 22,230) is on screen about 2 seconds after the double-click, launch included. Instead of ImageIO, a small reader seeks to the stored composite, unpacks only the rows it needs and averages them into the screen size in parallel bands (DispatchQueue.concurrentPerform, pread, no mmap). A 100 % part of the centre takes about 60 ms.
  • Photoshop layers. Files saved without “Maximize Compatibility” are drawn from their layers: all 27 blend modes, groups, masks, fills and 15 kinds of adjustment layer. Checked against Photoshop’s own composites in 108 test files, 104 match.
  • Photos library. File › Open from Photos browses your albums like folders, through PhotoKit.

Everything that can be tested without a window lives in a separate core module with about 1,500 Swift Testing tests.

I wrote up the PSB reader with the real code here: Why I stopped letting Apple’s ImageIO open huge PSDs: a fast native PSB reader in Swift 6 - DEV Community
And how the layer drawing was checked: Teaching Featherview to read Photoshop’s layers — mynetx

Code: GitHub - featherview/featherview: A fast, keyboard-driven image viewer for macOS with batch conversion. Native Swift. · GitHub
Website and download: https://featherview.mynetx.net
brew install --cask featherview/tap/featherview

Feedback on the code is very welcome, especially on the concurrency side.

Joachim

2 Likes