Skip to content

ParkinT/mandelbrot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This code was just scratch lying around, so it’s not particularly well-documented. Sorry about that. Or well-refactored. Sorry about that too. You’ll need RMagick to make it work. REALLY sorry about that. Don’t forget to compile in .png support.

It was mostly an experiment in ruby fiddling, so the code is not fast by any means. It takes several hours to do a good 1080p render. This could be accomplished in a few seconds in C, but that wasn’t the point when I wrote this. The point was to do it in Ruby, and that has been achieved. :-)

Just run

ruby genimage.rb

…I think. I think that will generate both mandel_right.png and mandel_left.png, but it might just generate one side, and you have to change a hardcode to get it to switch. Update: Yeah, it only generates one half of the image (the left half). Look at lines 29-30, comment out line 30 to set half=RIGHT_HALF and generate the other half of the image.

Oh yeah. So I originally intended this to generate fractal images for my desktop at work. I had two monitors, so I needed two images, ideally rendering adjacent areas of the mandelbrot plane.

Is the generator. All the parameters are hard-coded, sorry. There are some trivial image manipulation functions in there, mostly to adjust the viewport by scootching around the mandelbrot plane looking for interesting sections, and also to colorize the output on an interesting scale.

I wrote this about a year ago, so your guess is as good as mine when it comes to digging around in there to figure out what does what. If you document or refactor anything, please send me a pull request and I’ll merge it in.

This is just a scratch file where I experimented with the “twitterable” version, trying to reduce the number of characters as much as possible.

Brahbur’s mandelbrot solution, which was the first major compression improvement on my original. Probably should just be in my mandelbrot.rb file but like I said this whole project was just scratch code for fun.

About

Ruby script to generate mandelbrot fractals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published