In this recipe, we will combine the famous Mandelbrot fractal (see http://en.wikipedia.org/wiki/Mandelbrot_set) and the image of Lena. The Mandelbrot set was invented by the mathematician Benoit Mandelbrot. These types of fractals are defined by a recursive formula, where you calculate the next complex number in a series by multiplying the current complex number you have by itself and adding a constant to it. More details will be covered in this recipe.
Install SciPy if necessary. The See also section has a reference to the related recipe.
Start by initializing the arrays, followed by generating and plotting the fractal, and finally combining the fractal with the Lena image: