Mikedowney.co.uk
What's New
Site Map

Diary
Astronomy
Bits N Bobs
Computing
Food And Drink
Links
Photography
Welcome


Recipe Collections
Recipe A Week 2013
Recipe A Week 2010
A-Z of Regional Cakes
Alphabet of Nations


Selected Entries
Pinhole Photography
Keeping Quail
Coventry
Recipes
A different recipe each week
Friends websites
Oven Temperatures and Measuring Cups


Most popular stories
A Hamster's Home is his C...
Hamster Peanuts
Simple HDR photography wi...
A Tangfastic Mess
Halloween Animal Beds
Decaffeinated Coffee
Garden Fountain
Pizza, Hamsters and Ballo...
Hamster Baby Update
More Squirrel Photos
Not Quite HDR photography


RSS Feeds:
RSS Feed Entire Site.
RSS Feed Diary only.



Powered by Blosxom


Pinhole Photography Ring
pinhole webring logo
powered by RingSurf
Next | Previous
Random Site | List Sites

Mandelbrot Set animation

Story location: Home / computing /
27/Nov/2015

A couple of years ago I wrote an ImageJ plugin to draw the Mandelbrot Set. I recently updated it to make animations (download available here).

See more ....

To make an animation like the video, use the ImageJ 'polyline' tool to draw a line, with the spline option to smooth the line. Clicking on the Julia Set button will create a set of images which can be aligned using the following script:

var out = "zigzag1/";

run("TIFF Virtual Stack...", "open=[JuliaSet.tif]");
rename("julia");

var frames = nSlices;
var w = getWidth();
var h = getHeight();

run("TIFF Virtual Stack...", "open=[mandelbrot.tif]");
rename("brot");

setBatchMode(true);

for(i=1; i<=frames; i++){
    merge(i);
}

run("Close All");
setBatchMode(true);
print("Finished");
exit;

function merge(i){
imgname = "frame"+i;
newImage(imgname, "RGB black", w*2, h, 1);

selectWindow("julia");
setSlice(i);
run("Select All");
run("Copy");

selectWindow(imgname);
makeRectangle(w, 0, w, h);
run("Paste");

selectWindow("brot");
setSlice(i);
run("Select All");
run("Copy");

selectWindow(imgname);
makeRectangle(0, 0, w, h);
run("Paste");

fn =  out + imgname+".zip";
print(fn);
saveAs("ZIP", fn);
close();
}

The images will be saved in the folder given in the 'out' variable. Although this can be accomplished using the 'Combine' option in the ImageJ stack menu, the script works with virtual stacks so can handle much longer animations.



Game of Life

Story location: Home / computing /
15/Jun/2013

Here is the ImageJ version of the classic Game of Life which I wrote in an evening, several years ago. I have made a small change since then so the 'Reset' button clears the window and the 'Random' button fills the window with random dots.

See more ....
Game of Life running in ImageJ

The ImageJ drawing tools can be used to fill in pixels. Clicking on 'Start' will begin the animation. Pixels which have remained unchanged slowly fade to grey while pixels which 'came alive' are in white.

To Install

Download the source code and load into ImageJ or Fiji. Select 'Compile and Run' to start.

The program was cobbled together fairly quickly and ideally would need a bit more work to make it more user-friendly. Any configuration is done by editing the source code and recompiling. The speed of the animation can be changed by altering the value of 'pause' (value in milliseconds). The size of the world is given by the 'width' and 'height' variables. If these are changed then the image window may need to be resized by changing the default magnification in the setMagnification() command.



Mandelbrot Set

Story location: Home / computing /
13/Jun/2013

A few weeks ago I was reading the book The Emperors New Mind by Rodger Penrose and I reached the part where he discusses the Mandelbrot Set. Years ago I used to enjoy exploring this on my computer. I decided to download a mandelbrot program for my mac but couldn't really find one which I liked. This prompted me to have a go at writing one myself. I decided to cheat a little and write it as an ImageJ plugin so I didn't have to handle the display and mouse myself.

See more ....

I reused some bits of code from a version of Life which I wrote a few years ago and also some code which I developed during my PhD and managed to get a useable plugin up and running that evening. Over the next few days I added a few extra features and made it a bit more useable.

To Install

Click on the download link and save the 'jar' file into the ImageJ or Fiji plugins directory.

Download

To Run

Select 'Mandelbrot' from the 'Plugins' menu. Configuration options are in the 'About Plugins' submenu of the 'Help' menu. After changing any options, the mandelbrot set window will need to be closed and the plugin re-run before any changes will come into effect.

How to Use

Mandelbrot Set in ImageJ

To zoom in or out, use the 'Point' tool of ImageJ to select the new centre and click on either the 'Zoom To' or 'Zoom Out' buttons at the bottom of the window. To pan the view without changing the zoom, select the new centre then click on the 'Re-Centre' button. The 'Reset' button returns the view back to the original zoom.

The number selection box to the right of 'Reset' controls how many calculations are performed before the algorithm decides whether a point belongs to the set or not. Increasing this number will show more detail at the fringes of the set at higher zoom levels.

The Normal/Sqrt/Log selection controls how the colour values are calculated. Initially all values are displayed in greyscale. To display in colour, select one of the ImageJ lookup tables for the required colour scheme.

Julia Set in ImageJ

Finally the Julia Set for a particular point can be displayed by selecting a point then clicking on the 'Julia Set' button.

More Details

Further details on the Mandelbrot Set and Julia set can be found in Wikipedia.