Fractal Transform, made with Pixel Bender

I made a Pixel Bender filter that performs Julia Set transformations on images. It looks great when it animates, the colors morph and twist like mathematical slime. Try it (Flash Player 10 required): JuliaTile.swf

Source code: Pixel Bender code is in src/shader/.

The default image is Seattle’s Space Needle. You can upload custom images. Very large images may set your processor on fire.

Parameters: Iterations sets how many times the Julia formula is applied per pixel. The iteration increments appear smooth, not stepped, because the code tweens across the destination coordinates of the two nearest iterations. Complex X&Y are the real & imaginary values of the transform constant. Bias X&Y is something I hacked in, it skews the coordinates in a linear way, becoming more intense with each iteration.

The Fill Types are as follows:

  • 0: Pixels out of range are transparent; no fill.
  • 1: Repeats the nearest edge pixel.
  • 2: Repeats the source image, mirroring every other copy to create a smooth transition.
  • 3: Repeats the source image without mirroring.

The filter needs more features before it’s “done”, hopefully it’s still enjoyable. The Pixel Bender code took about 30 minutes to write; the Flex wrapper took much longer.

Despite its limited feature set, Pixel Bender is pretty cool. My only misgiving is that Pixel Bender’s runtime performance is never as good as I hope. I have another filter in the works that mimics NTSC television artifacts, but the performance is abysmal. The code can still be optimized; stay tuned.

4 thoughts on “Fractal Transform, made with Pixel Bender

  1. in case of performance…
    1. try optimizing your shader in asm (compiler/decompiler can be found on
    2. use ShaderJob instead of ShaderFilter
    3. always use bitmaps with transparency (i’m not 100% sure about it, but i have a weird feeling that conversion from ARGB to floats, done by hydra every time shader is called, is optimized for images with 4 channels) – 100% realtime, 100% single pass, 100% shaders ;)

  2. Hey Zach, can you post your NTSC pixelbender?

    I was thinking of doing the same thing the other day after seeing the NTSC emulation in Kega Fusion

  3. James: Sure, I’ll clean up my code and blog it tomorrow or this weekend… Unfortunately the code isn’t optimized yet, but that’s on my hit list.

Leave a Reply

Your email address will not be published.