Created
June 30, 2017 03:29
-
-
Save tad-iizuka/f6c6cb6e2d3cea71a44ce7fe395e5913 to your computer and use it in GitHub Desktop.
Blending two images by using GPUImage 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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