MRaster examples 21.0.0.0
Image Processing Library
Loading...
Searching...
No Matches
mandelbrot_wave.cpp File Reference

Animate a mandelbrot-like fractal with a variable coeficient. More...

Go to the source code of this file.

Detailed Description

Animate a mandelbrot-like fractal with a variable coeficient.

Author
Mitch Richling https://www.mitchr.me
Standards
C++20
See also
https://www.mitchr.me/SS/mandelbrotWave/index.html
Details


Iterate \(f(x)=z^5+a\cdot z+c\) as one would \(f(z)=z^2+c\) to render a Mandelbrot set. Vary the parameter \(a\) by moving it around the unit circle, and drop out an image for each \(a\). The resulting images may be rendered into movies like this:

  • Make a gif convert -delay 1 -loop 0 -dispose previous mandelbrot_wave_???.tiff mandelbrot_wave_mean.gif
  • Make a smaller gif gif convert -delay 1 -loop 0 -dispose previous -resize 50% mandelbrot_wave_???.tiff mandelbrot_wave_mean_50.gif
  • For a GIF that runs forward and backward: convert -delay 1 -loop 0 -dispose previous $(ls mandelbrot_wave_???.tiff) $(ls -r mandelbrot_wave_???.tiff) mandelbrot_wave_wavy.gif
  • Convert all the TIFF files into PNG so we can use ffmpeg to make a WEBM movie ls mandelbrot_wave_???.tiff | xargs -P 0 -I{} sh -c 'echo {}; convert {} $(echo {} | sed "s/\.tiff$/.png/;")'
  • Convert the PNGs into a WEBM ffmpeg -r 15 -i mandelbrot_wave_%03d.png mandelbrot_wave_mean.webm
  • Clean up the PNGs rm mandelbrot_wave_???..png

Note the frames are rendered 8x larger than the final images. I use an 8x, mean scale down to smooth the image out a bit.

Definition in file mandelbrot_wave.cpp.