If you need an easy way to do this, my GPUImage framework has its own GPUImageMultiplyBlendFilter, which takes two images and performs red, green, blue, and alpha channel multiplication for each pixel. It does this with GPU acceleration, so it can be 4-6X faster than performing the same operations with the processor.
To use this, set up two images for blending:
UIImage *inputImage1 = [UIImage imageNamed:@"image1.jpg"];
GPUImagePicture *stillImageSource1 = [[GPUImagePicture alloc] initWithImage:inputImage1];
UIImage *inputImage2 = [UIImage imageNamed:@"image2.jpg"];
GPUImagePicture *stillImageSource2 = [[GPUImagePicture alloc] initWithImage:inputImage2];
blend:
GPUImageMultiplyBlendFilter *blendFilter = [[GPUImageMultiplyBlendFilter alloc] init];
[inputImage1 processImage];
[inputImage1 addTarget:blendFilter];
[inputImage2 addTarget:blendFilter];
[inputImage2 processImage];
, , :
UIImage *filteredImage = [blendFilter imageFromCurrentlyProcessedOutput];
, , , iPad 2, , 2048x2048 . .