pygame is
Simple DirectMedia Layer is
Site Swing
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 :-)


Home Page:


click to view original size


Perlin Noise Generator - 1.0 - Feb 28, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

February 28, 2009 11:06pm - Ian Mallett - nickname: (geometrian)
Er, look at the defaults. This renders 8 waves of Perlin Noise for every pixel. The result is certainly not going to be speedy in software. Put "octaves" at 1, and it should run a lot faster. That said, I did mean for this to be pre-computation device--you can save the image and use it later.
February 28, 2009 7:43pm - pymike - nickname: (pymike)
Neat sim. Too slow to be of use though.
February 28, 2009 7:26pm - Ian Mallett - nickname: (geometrian)
Version 1.0 released! (Versions 0.1, 0.2, and 0.3 were prerelease work)

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
May 29, 2016

May 27, 2016

May 21, 2016

May 18, 2016

May 1, 2016

Mar 27, 2016

Mar 26, 2016

Mar 22, 2016

Mar 19, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)