Blurring a shape

edited December 2016 in How To...

There are many (thousands) ellipses which I want to animate. they have different sizes and I want to give them varying blurring effects. To make them seem more smooth and less crisp. I tried using filter() with BLUR. But this only works on Pimage objects, not on Pshapes, so this blurs the whole image. Also it is quite slow.

Is there a way to apply a blurring effect specifically to a shape? perhaps using an external library?

Tagged:

Answers

  • A PShape just stores the positions and colors of vertices (besides some other properties).
    How do expect to blur a PShape then?
    You're using 2D, right?

  • I figured I am probably not the first one to look for this functionality. So I am hoping there is some solution. I am using the default renderer.

  • Solution? No idea. Workaround? Yes.
    Use a PGraphics object (not exactly the fastest, but will work faster than blurring each time in draw()).
    Draw your PShape onto the PGraphics object, and use it wherever required.

    P.S. If you're going to use scale etc, then this won't work.

Sign In or Register to comment.