Skip to content

Instantly share code, notes, and snippets.

@maxmzd
Last active August 29, 2015 14:07
Show Gist options
  • Save maxmzd/67b3013c75b30afd65ba to your computer and use it in GitHub Desktop.
Save maxmzd/67b3013c75b30afd65ba to your computer and use it in GitHub Desktop.
Example of how to use a GPUImage Blend Filter in Swift
let filter = GPUImageOverlayBlendFilter()
filter.useNextFrameForImageCapture()
var picture_1 = GPUImagePicture(image: UIImage(named: "bun-outline.png"))
var picture_2 = GPUImagePicture(image: UIImage(named: "pink.png"))
picture_1.addTarget(filter)
picture_1.processImage()
picture_2.addTarget(filter)
picture_2.processImage()
// Write it to a UIImageView on the interface
bun.image = filter.imageFromCurrentFramebuffer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment