How To Generate A Pink Noise Image?
I am trying to replicate 'Frequency Synthesis of Landscapes' by P. Bourke in Python. I thought it would be a simple import numpy as np from scipy.fft import fft2, ifft2 whitenoise
Solution 1:
The problem here is that by computing pinktransformed = np.reciprocal(fouriertransformed)
you compute the reciprocal of the amplitudes, but what you actually want is scaling these amplitudes by 1/f**2
, so you'd have to replace that line with
pinktransformed = fouriertransformed / f**2
where f
is an array that contains the frequencies corresponding to each bin of the fourier transform.
Post a Comment for "How To Generate A Pink Noise Image?"