ios – GPU accelerated picture / video and digital camera filter library based mostly on Swift


Harbeth is a excessive efficiency Swift library for GPU-accelerated picture processing and realtime digital camera seize and video easy playback, after which add filters based mostly on Metallic, and likewise appropriate for CoreImage filters and metallic efficiency shaders filters.

  • Help extra platform system, macOS and iOS, each UIKit/AppKit and SwiftUI.
  • Excessive efficiency shortly add filters at these sources: UIImage, NSImage, CIImage, CGImage, CMSampleBuffer, CVPixelBuffer.
  • The built-in metallic kernel filters is roughly divided into the next modules: Mix, Blur, Pixel, Coordinate, Lookup, Matrix, Form, Generator.
  • Setup MetalPerformanceShaders filters And likewise appropriate for CoreImage filters.
  • Previews and rendering backed with the facility of Metallic.
  • Drop-in help in your personal customized filters utilizing LUTs or utilizing Dice.
  • Realtime digital camera seize and video easy playback with filters.
  • Video supply processing video file by Kakapos library.

🎷 – Code zero intrusion add filter operate for picture.

let filter1 = C7ColorMatrix4x4(matrix: Matrix4x4.Coloration.sepia)
let filter2 = C7Granularity(grain: 0.8)
let filter3 = C7SoulOut(soul: 0.7)

let filters = [filter1, filter2, filter3]

// Use:
let dest = BoxxIO.init(ingredient: originImage, filters: filters)
// Synchronize do one thing..
ImageView.picture = attempt? dest.output()

// OR Use:
ImageView.picture = attempt? originImage.makeGroup(filters: filters)

// OR Use Operator:
ImageView.picture = originImage ->> filter1 ->> filter2 ->> filter3

// Asynchronous do one thing..
dest.transmitOutput(success: { [weak self] picture in
    // do one thing..

Share a narrative about the right way to use Metallic to implement filters