Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tad-iizuka/f6c6cb6e2d3cea71a44ce7fe395e5913 to your computer and use it in GitHub Desktop.
Save tad-iizuka/f6c6cb6e2d3cea71a44ce7fe395e5913 to your computer and use it in GitHub Desktop.
Blending two images by using GPUImage 2
let alphaBlend = AlphaBlend()
alphaBlend.mix = 0.5
let input1 = PictureInput(image: UIImage.init(named: "IMAGE1.jpg")!)
let input2 = PictureInput(image: UIImage.init(named: "IMAGE2.jpg")!)
let output = PictureOutput()
output.imageAvailableCallback = {image in
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}
input1 --> alphaBlend
input2 --> alphaBlend --> output
input1.processImage(synchronously: true)
input2.processImage(synchronously: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment