0
我想使用GPUImage調整圖像的不透明度,並使用此圖像與其他圖片混合。 這裏是我如何使用:GPUImage無法將不透明度過濾的圖像與其他人混合
GPUImagePicture *originPic = [[GPUImagePicture alloc] initWithImage:image];
UIImage *copyImage = [UIImage imageWithCGImage:image.CGImage];
GPUImageOpacityFilter *opacity = [[GPUImageOpacityFilter alloc] init];
[opacity setOpacity:0.5];
UIImage *opacityAdjusted = [opacity imageByFilteringImage:copyImage];
GPUImagePicture *opacityAdjustedPic = [[GPUImagePicture alloc] initWithImage:opacityAdjusted]
GPUImageScreenBlendFilter *screenBlend = [[GPUImageScreenBlendFilter alloc] init];
[originPic addTarget:screenBlend];
[opacityAdjusted addTarget:addTarget:screenBlend];
[originPic processImage];
[opacityAdjusted processImage];
UIImage *output = [screenBlend imageFromCurrentlyProcessedOutput];
我顯示的輸出,但結果是一樣的「originPic與copyPic融爲一體」,我要的是「originPic與0.5opacityCopyPic融合」