GPUImage: Darker iOS 7 Blur Effect

邮差的信 提交于 2019-12-05 18:45:53
Brad Larson

As I describe in the comments here, the "whitening" effect that the GPUImageiOSBlur filter provides is due to a luminance range restriction that I apply in the last step of that operation. The filter itself is a grouped filter, where the image is first desaturated and downsampled, Gaussian blurred, and then upsampled and luminance range restricted in the last step.

That last step is performed using a GPUImageLuminanceRangeFilter, which I built to replicate the exact effect that Apple seems to apply to most of their overlay blurs. They appear to use a different color effect in others, though, so to mimic that you'll want to change that last step in the filter.

I might make this something that the user can specify as a tint color later on, but for now you can create your own custom filters based on GPUImageiOSBlurFilter and GPUImageLuminanceRangeFilter, and change your implementation of GPUImageLuminanceRangeFilter to alter the final colors to be darker than what is provided normally. You'll have to experiment with the values in that fragment shader to see what produces the effect you want.

Other people have done this, to good effect, but none have fed it back in as a pull request yet.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!