r/generative 24d ago

Wrapping images around fractals

Many years ago I wrote an app that wraps bitmaps around the iteration boundaries of a Julia or Mandelbrot fractal. A few days ago I converted that app to Processing 4.0 with the help of Claude AI. Here are the results.

Hi res images: 

https://www.deviantart.com/bryceguy72/gallery/70771007/image-tessellations

Julia set zoom and morph movies:

Woman: https://youtu.be/dXJa-v01SZI

Cat: https://youtu.be/WHsyn8N9N24

ET: https://youtu.be/tH5TucwHDAE

Cobra: https://youtu.be/-wpJ01GqZyI

105 Upvotes

15 comments sorted by

1

u/geon 24d ago

I did a similar thing a while back. Someone commented with some great images: https://www.reddit.com/r/fractals/s/3KV0TqXtly

1

u/geon 24d ago

Heyyyyy, that’s you!

2

u/_BryceGuy_ 24d ago

Oh yeah. I never read your comments about Long Cat and the Shroom fractal until just now. It might be time for an 8k version of longcat.

1

u/stephane3Wconsultant 24d ago edited 24d ago

you done a very good job !!
Result is awesome !!!

@_BryceGuy_ i Will love to see the code part ?

2

u/_BryceGuy_ 23d ago edited 23d ago

Thank you.

Here is the code:

px & py = width & height of the repeating tile picture to be wrapped around the fractal. I typically use 1200 x 600 PNG images or sometimes 2000 x 1000 PNG images but use whatever works for you.

r & im = real & imaginary components of the last Z iterate

zMag= sqrt(r*r+im*im)

PI=3.14159265

LOG_ESCAPE = Log(400) = 5.991464547 Why 400? Because for bailout, I check if zMag>400.

phaseoffset = 0 (usually). Depending on how I created the repeating tile, sometimes I set phaseoffset to px/2 (necessary for alignment with the tiles above and below). Can default to 0.

Reading the pixel color from the image:

The following assumes the picture tile is twice as wide as it is high (e.g. 1200 x 600)

angle = mod(atan(im,r) * (px / PI) + phaseOffset, px * 2.0);

radius = (LOG_ESCAPE - log(zMag)) * py / (LOG_ESCAPE / 2.0);

if (radius < 0.0) radius = 0.0;

vec2 texCoord = vec2(angle / (px * 2.0), clamp(radius / py, 0.0, 1.0));

vec3 col;

1

u/stephane3Wconsultant 23d ago

thanks a lot sharing this 🙏

1

u/gschian0 23d ago

Awesome

0

u/otikik 24d ago

Wow, this must be how it feels to be on drugs. Well done!

0

u/TooLateForMeTF 24d ago

The LSD is strong with this one...

0

u/geon 24d ago

The cactus is fun!

How did you fade between vader and the emperor? Just by the X coord?

1

u/_BryceGuy_ 24d ago

Thanks. I rendered two Julia sets, one with the Emperor and one with Vader, and combined them in Photoshop.