M=Compile[{x,y},Block[{z=x+I y,k=0},While[Abs[z]<2&&k<50,z=z^2+x+I y;++k];k]];
DensityPlot[50-M[x,y],{x,-2.,1.},{y,-1.5,1.5},PlotPoints->200,Mesh->False];

