BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.88k stars 611 forks source link

Transparency Issue with All Filters #302

Open kerbelda opened 5 years ago

kerbelda commented 5 years ago

Hi, very excited to use the framework but I'm running into an issue. I'm using AVPortraitEffectsMatte to generate a "cutout" of a picture. It uses the CIFilter below

maskCode

Then I apply a filter like such:

filteringCode

The cutout works great but when I go to add a simple filter like Brightness, the background no longer stays transparent, as seen with the images below. I've tried using a UIImageView as well as a RenderView.

Before: before

After: after

Is there anything I can do on either end (masking or adding filters) to keep that transparency? I'm planning to do some real time filtering as well as one time outputs. Edit: This also happens with any PNG photo that has a transparency.

deshan commented 5 years ago

https://github.com/BradLarson/GPUImage2/issues/298#issuecomment-488699644

leehiuleong commented 1 week ago

any solution? same problem.