Perlin Noise Generator
Perlin Noise Generator - 1.0
Ian Mallett (geometrian)
I needed Perlin noise for a program I'm writing, and there weren't any good, easy implementations to use, nor any I could find in Python.
In a few hours I came up with this. It should be pretty straightforward. All the parameters are laid out--though you'll probably need to look around to find what they actually mean in detail. In brief, Perlin noise functions provide randomly generated noise. The features of this noise are all precisely the same size. By layering different frequency "waves" of this noise on top of each other, you can get chaotic looking random stuff. Higher frequency waves have less influence (amplitude). The number of waves is defined by "octaves" (line 98), the "persistence" (line 99) tells the factor by which the amplitude decreases over each harmonic, "tiledim" (line 21) is the number of cycles in the 1st order harmonic in one tile (before it repeats), and "repeats" (line 22) is the number of repeated tiles on the screen. The inputs as they are now generated the screenshot.
The screen shot was generated using an unmodified version of this program (the parameters are all the same). The screenshot is a single tileable 512x512 image in greyscale. I included a tiletester, which allows you to select a file and then visually see if the edges line up. All images created by this program should, as long as "repeats" is an integer.
Released as open source, as always. Give me a ping if you find this useful :-)
Pygame.org account Comments
If you wish to leave a comment with your pygame.org account, please sign in first.