How to make Filter animations?

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

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?!

Greetings

mexyn

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

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 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

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.

nuthinking
User offline. Last seen 8 years 26 weeks ago. Offline
Joined: 10/07/2012
Posts:

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

Is this the same problem of: http://www.sunsetlakesoftware.com/forum/update-filtered-image ?

Thanks

Syndicate content