Created
November 9, 2022 01:51
-
-
Save tgzw/d015991934e4e70dc3404ca31f839190 to your computer and use it in GitHub Desktop.
Perlin noise in python using the perlin-noise package. 3-4 octaves seem to be the ideal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # !pip install perlin-noise | |
| import matplotlib.pyplot as plt | |
| from perlin_noise import PerlinNoise | |
| noise = PerlinNoise(octaves=3, seed=1) | |
| xpix, ypix = 100, 100 | |
| pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)] | |
| plt.imshow(pic, cmap='gray') | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment