Setting Map Size, Image Size & Output Directory - BriannaLadson/TerraForge GitHub Wiki

Setting the Map and Image Sizes

TerraForge allows you to control both the size of the generated map and the dimensions of the output images, giving you flexibility over resolution, scale, and performance.


Setting the Map Size

The default map size for TerraForge is 100x100. To change the map size, pass in the map_size parameter and set it to a positive integer. If the map size is smaller than the image size, the map will have a pixelated look.

generator = TerraForge(map_size=200)

Below are images of maps where the map_size is different but the image_size is the same.

biome_map biome_map


Setting the Image Size

The default image size is whatever the map size is. To change the image size, pass in the image_size parameter and set it to a tuple that contains the width and height of your desired size.

generator = TerraForge(image_size=(200,300))

Below are images of maps where the image_size is different but the map_size is the same.

biome_map biome_map


Setting the Output Directory

By default, the generated map images are saved in the same directory as your script. You can change this by passing the output_dir parameter into the .generate() method and setting it to your desired directory.

generator.generate(output_dir="maps")