diff --git a/world_maker/data/building_moutain.png b/world_maker/data/building_moutain.png index abf5458..9f65e2d 100644 Binary files a/world_maker/data/building_moutain.png and b/world_maker/data/building_moutain.png differ diff --git a/world_maker/data/district.png b/world_maker/data/district.png index 36b25df..f514364 100644 Binary files a/world_maker/data/district.png and b/world_maker/data/district.png differ diff --git a/world_maker/data/heightmap.png b/world_maker/data/heightmap.png index 98eca9a..3a34c98 100644 Binary files a/world_maker/data/heightmap.png and b/world_maker/data/heightmap.png differ diff --git a/world_maker/data/heightmap_smooth.png b/world_maker/data/heightmap_smooth.png index 780df58..3210990 100644 Binary files a/world_maker/data/heightmap_smooth.png and b/world_maker/data/heightmap_smooth.png differ diff --git a/world_maker/data/heightmap_smooth_2.png b/world_maker/data/heightmap_smooth_2.png index 8b081d2..cb2114b 100644 Binary files a/world_maker/data/heightmap_smooth_2.png and b/world_maker/data/heightmap_smooth_2.png differ diff --git a/world_maker/data/heightmap_with_building.png b/world_maker/data/heightmap_with_building.png index 780df58..bc05948 100644 Binary files a/world_maker/data/heightmap_with_building.png and b/world_maker/data/heightmap_with_building.png differ diff --git a/world_maker/data/removed_treesmap.png b/world_maker/data/removed_treesmap.png index 434627a..da941ff 100644 Binary files a/world_maker/data/removed_treesmap.png and b/world_maker/data/removed_treesmap.png differ diff --git a/world_maker/data/skeleton_highway.png b/world_maker/data/skeleton_highway.png index 042b575..734bb47 100644 Binary files a/world_maker/data/skeleton_highway.png and b/world_maker/data/skeleton_highway.png differ diff --git a/world_maker/data/skeleton_mountain.png b/world_maker/data/skeleton_mountain.png index 042b575..734bb47 100644 Binary files a/world_maker/data/skeleton_mountain.png and b/world_maker/data/skeleton_mountain.png differ diff --git a/world_maker/data/smooth_for_highway.png b/world_maker/data/smooth_for_highway.png index 9345f27..3acbd16 100644 Binary files a/world_maker/data/smooth_for_highway.png and b/world_maker/data/smooth_for_highway.png differ diff --git a/world_maker/data/sobelmap.png b/world_maker/data/sobelmap.png index bb24c47..c948264 100644 Binary files a/world_maker/data/sobelmap.png and b/world_maker/data/sobelmap.png differ diff --git a/world_maker/data/sobelmap_from_smooth.png b/world_maker/data/sobelmap_from_smooth.png index f683144..ff87ff7 100644 Binary files a/world_maker/data/sobelmap_from_smooth.png and b/world_maker/data/sobelmap_from_smooth.png differ diff --git a/world_maker/data/treemap.png b/world_maker/data/treemap.png index 07aaab3..91e5097 100644 Binary files a/world_maker/data/treemap.png and b/world_maker/data/treemap.png differ diff --git a/world_maker/terraforming.py b/world_maker/terraforming.py index 2ded98d..6273cd7 100644 --- a/world_maker/terraforming.py +++ b/world_maker/terraforming.py @@ -31,11 +31,8 @@ def remove_trees(heightmap: Union[str, Image], treesmap: Union[str, Image], mask if mask.getpixel((x, z)) != 0 and treesmap.getpixel((x, z)) > 0: tree_area = morphology.flood(treesmap, (z, x), tolerance=1) - blend = img.blend(img.fromarray(tree_area).convert( - 'L'), removed_treesmap.convert('L'), 0.5) - array = np.array(blend.convert('L')) - bool_array = array > 1 - removed_treesmap = img.fromarray(bool_array) + removed_treesmap = img.fromarray( + np.where(tree_area, treesmap, 0).astype(np.uint8)) y = heightmap.getpixel((x, z)) y_top = removed_treesmap.getpixel((x, z))