# Generate some with pure pink noise and some with our combined noise algorithm grp = gen_pink(size=128) gr = gen_combined(128, ratio=0.4, roughness=0.47, peaks=16*2) og = np.copy(gr) ogp = np.copy(grp) # Perform erosion on both i=3 cycles = (1000000*6)//2 erode_heightmap(gr, dt=0.25, cycles=cycles, evaporation_rate=0.00001, friction=0.0001, deposition_rate= (1.0/6.0)*(i+1)) erode_heightmap(grp, dt=0.25, cycles=cycles, evaporation_rate=0.00001, friction=0.0001, deposition_rate= (1.0/6.0)*(i+1)) # Draw them so we can compare f, axarr = plt.subplots(2, 2, figsize=[10, 10]) # Top combined axarr[0][0].imshow(og, cmap='gray') axarr[0][1].imshow(gr, cmap='gray') # Bottom pnk axarr[1][0].imshow(ogp, cmap='gray') axarr[1][1].imshow(grp, cmap='gray') plt.show()im = Image.fromarray((grp*200).astype(np.uint8), 'L') im.save('heightmap.png')
# Generate some with pure pink noise and some with our combined noise algorithm grp = gen_pink(size=128) gr = 0.5*gen_voronoi(128, 16) + 0.5*grp og = np.copy(gr) ogp = np.copy(grp) # Perform erosion on both i=3 cycles = (1000000*6)//2 erode_heightmap(gr, dt=0.25, cycles=cycles, evaporation_rate=0.00001, friction=0.0001, deposition_rate= (1.0/6.0)*(i+1)) erode_heightmap(grp, dt=0.25, cycles=cycles, evaporation_rate=0.00001, friction=0.0001, deposition_rate= (1.0/6.0)*(i+1)) # Draw them so we can compare f, axarr = plt.subplots(2, 2, figsize=[10, 10]) # Top combined axarr[0][0].imshow(og, cmap='gray') axarr[0][1].imshow(gr, cmap='gray') # Bottom pnk axarr[1][0].imshow(ogp, cmap='gray') axarr[1][1].imshow(grp, cmap='gray') plt.show()