This is an implementation of algorithm similar to the diamond-square algorithm, that can generate natural-looking heightmaps.
You can download this repo and then install required libraries by running this command in the project directory:
pip3 install -r requirements.txt
To generate new image, run this command in project directory:
python generate.py [iterations] [smoothness]
iterations
- number of iterations. After each iteration image size is roughly doubled.smoothness
- smoothing factor. The bigger it is, the smoother the end picture.
After running this command, the generated.png
file should appear in the working directory.
python generate.py 10 1.5
- generates 1025x1025 image.
python generate.py 10 10
python generate.py 10 0.9