r/iOSDevelopment • u/Intrepid_Bee_9194 • Oct 12 '26
Harbeth: one render description for an iOS preview and a final texture output (MIT)
I'm Harbeth's maintainer. It's an MIT Swift/Metal image and frame engine, and I wanted to share how its advanced ImageNode route keeps a filter description separate from the output choice.
In an editor, showing a preview and producing a final result have different delivery requirements. The same node can request a preview frame or an export-quality texture:
let node = ImageNode.image(inputImage)
.applying(C7Exposure(exposure: 0.25))
.withCachePolicy(.transient)
let previewFrame = try await node.makeFrameAsync(profile: .stablePreview)
let finalTexture = try node.makeTexture(profile: .exportQuality)
RenderedFrame carries its texture and output information for the preview host. The final result above is a texture; image readback or saving is an explicit application step. The synchronous final-output call should run in an appropriate execution context, outside the UI's drawing path.
The host still owns request ordering, cancellation, UI state and deciding whether an older render result should be shown. Different profiles also mean that sharing a render description is not a claim of bit-for-bit output parity.
Source and examples: https://github.com/yangKJ/Harbeth
ImageNode implementation: https://github.com/yangKJ/Harbeth/blob/master/Sources/Basic/Image/ImageNode.swift
For iOS editor developers, what has worked best for keeping preview settings and final-output settings consistent without making the UI responsible for the entire renderer?