Recognitions:

## MATLAB - Image Processing - Douday's rabbit fractal

 Quote by mheslep For anyone interested, here's the same code in Python
Thanks for the info mheslep. Very interesting, I'll have to take a look at those python modules. In the past I know it's been common to translate matlab to fortran for faster execution. I have actually translated the above code in Fortran and it is indeed several times faster than the matlab code (though i did it more as a sanity check in this case) BTW. Also take a look at gnu-octave for an excellent freeware matlab clone.

Back to the question of why greenprint is getting unexpected results. Would you be able to make a quick test for us with that python code to test the conjecture that the direction of the inequality in a = np.where(np.abs(z)<sqrt5) should cause either a multi-level or a
two-level map to be produced.

In particular could you please test if replacing the above line with, a = np.where(np.abs(z)>sqrt5), causes your program to produce only a two level map (and a corresponding monochrome image).

Recognitions:
Gold Member
 Quote by uart ... Back to the question of why greenprint is getting unexpected results. Would you be able to make a quick test for us with that python code to test the conjecture that the direction of the inequality in a = np.where(np.abs(z)sqrt5), causes your program to produce only a two level map (and a corresponding monochrome image).
Sure. The orginal, abs(z)<sqrt(5):

and the almost(?) monochrome image obtained from
abs(z)>sqrt(5):

Recognitions:
 Recognitions: Gold Member Ah, thanks. Numpy has a hack around for the overflow that (efficiently) forces NaN's to zeros: http://www.scipy.org/Numpy_Example_L...21e560ab316ef3 So that Code:  ... z = z**2 + c z = np.nan_to_num(z) a = np.where(np.abs(z)>sqrt5) map[a] = k ... produces the attached image as you would expect Attached Thumbnails