How to make Filter animations?

3 replies [Last post]
User offline. Last seen 9 years 19 weeks ago. Offline
Joined: 07/19/2012

Hey Brad,

first things first --> thanks for that great job!

I want to apply a gaussian blur filter on a UILabel. Using your library makes this a piece of cake now. But the next step i want to achieve is, to animate from the original state to the blurred state and all the way back to the original state. And on top i want to loop this behaviour.

I don't have a clue if this is even possible without having performance issues. Maybe you have some hints for me on this one?!



User offline. Last seen 1 year 42 weeks ago. Offline
Joined: 07/22/2012

I have exactly the same question. I know about how to drive UIView animations with the simple block APIs, and how to work with CA layer animations (e.g for animating shape layers). Could this be done with CA keyframe animations, or do we need to use something different?

I suppose a bruteforce approach would be to drive the animation with a NSTimer and just adjust the parameters from the timer callback, but this means I’d have to calculate all the curves and such stuff myself. Maybe there is a more elegant approach?

So a specific example that both the OP and me would like to do, is to have a UIImageView, and then adjust the blur of its UIImage over a period of time.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 49 weeks ago. Offline
Joined: 05/14/2008

There really isn't an easy way to animate the filters right now. The best approach would be to create a GPUImagePicture from your source UIImage, set up a filter for that, and then attach that filter to a GPUImageView for display. Every time a timer would fire, adjust the parameters of the filter appropriately and call -processImage on the picture source.

I suppose a generic animator proxy could be set up for the filters like NSView has for animation, but I don't have anything in the framework that does this right now.

User offline. Last seen 9 years 1 week ago. Offline
Joined: 10/07/2012

Brad Larson wrote:
There really isn't an easy way to animate the filters right now...

Is this the same problem of: ?


Syndicate content