Silence-GitHub / BBMetalImage

A high performance Swift library for GPU-accelerated image/video processing based on Metal.
MIT License
988 stars 126 forks source link

Transparency Issue with PNG Images #8

Closed kerbelda closed 4 years ago

kerbelda commented 5 years ago

Hi, I'm having some issues with the transparency in PNG images. When I apply an effect to an image, the transparency is lost. Below is the code and a before/after.

Edit: How I generated the PNG might be helpful:

maskCode

imageViewOne is just a UIImageView. bbFilterCode

Before: bbBefore

After: bbAfter

How do I apply filters and keep the transparency of a PNG image?

Silence-GitHub commented 5 years ago

Contrast filter dose not change the alpha value. Are you sure the alpha value of the transparent part is 0?