In [2]:
%matplotlib inline
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter

def smooth_noise(shape, sigma):
    return gaussian_filter(np.random.normal(size=shape),sigma)

def scaling_noise(shape):
    S = np.zeros(shape)
    i = np.max(shape) / 4
    while i >= 2:
        noise = smooth_noise(shape,i)
        S += noise * (i+1)**2
        i /= 2
    return S

n = 250
S = scaling_noise((n,n))

fig, (ax1, ax2) = plt.subplots(ncols=2,figsize=(12,12))
ax1.imshow(S)
ax2.imshow(S,cmap='Blues')


Out[2]:
<matplotlib.image.AxesImage at 0x7f4fae732410>