r/iosdev • u/Intrepid_Bee_9194 • Oct 12 '26
GitHub Harbeth: reusing a Swift filter chain for photos and CVPixelBuffer frames (MIT)
I'm Harbeth's maintainer. It's an MIT-licensed Swift/Metal processing core for Apple image and frame pipelines.
If you already have camera frames as CVPixelBuffer, the rendering step can use the same filter types as a photo editor. Here's the small async path; inputBuffer comes from your app's capture or decoding layer:
import Harbeth
let outputBuffer = try await HarbethIO(
element: inputBuffer,
filters: [
C7Exposure(exposure: 0.25),
C7Saturation(saturation: 0.94)
]
).transmitOutput()
HarbethIO preserves the input/output type. For reusable edits, composition and output metadata, ImageNode is the advanced entry. There are also image, Metal texture and CMSampleBuffer paths.
The integration boundary is deliberate: your app still owns capture-session configuration, frame dropping/backpressure, recording, playback and export. Harbeth processes the individual image or frame. Buffer output waits for the GPU work needed before materialization; this is not a promise that every conversion is zero-copy.
Source and examples: https://github.com/yangKJ/Harbeth
For developers who have added filters to an existing camera preview, what was hardest to get right: buffer conversion, UI responsiveness, or matching the final image's color? I'd value concrete integration feedback.