perlin-numpy
perlin-numpy copied to clipboard
Numerical issues
When I run generate_perlin_noise_2d((721, 1281), (7, 7), (True, True))
I get the following issue:
ValueError: operands could not be broadcast together with shapes (722,1281,2) (721,1281,2)
This can be fixed by enumerating the grid manually instead of using np.mgrid
:
grid = np.stack(np.meshgrid(
np.arange(0, shape[1]) * res[1] / shape[1],
np.arange(0, shape[0]) * res[0] / shape[0],
)[::-1], axis=-1)