Lucas Comim
Lucas Comim

Reputation: 3

PNG UIImage with transparency loosing alpha after GPUImageBrightnessFilter

I'm trying to manipulate an UIImage brightness with GPUImageBrightnessFilter with the following code.

GPUImagePicture *source = [[GPUImagePicture alloc] initWithImage:_imgMask smoothlyScaleOutput:YES];
GPUImageBrightnessFilter *brightness = [[GPUImageBrightnessFilter alloc] init];

[source addTarget: brightness];
[brightness addTarget:GPUImageView];

[source processImage];

But the output image is generated without the original transparency. Am I missing something to generate the output image with the original transparency?

Thanks

Upvotes: 0

Views: 767

Answers (1)

brandonscript
brandonscript

Reputation: 73044

To my knowledge, GPUImagePicture does not support an alpha channel when translated back to a UIImage.

You could, however, display the native GPUImagePicture in a GPUImageView - setting the backgroundColor property of the imageView to [UIColor clearColor].

See this ticket for more info.

Upvotes: 1

Related Questions