Skip to content

Instantly share code, notes, and snippets.

@WiggleWizard
Last active November 10, 2022 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WiggleWizard/59baba25b26fb7aee080377a15071f03 to your computer and use it in GitHub Desktop.
Save WiggleWizard/59baba25b26fb7aee080377a15071f03 to your computer and use it in GitHub Desktop.
Packs UE world partition exports of 32-bit heightmap data into a single 32-bit image
from PIL import Image
import glob, os
# Size of each partition image
in_size = 504
# How many partitions there are per axis
x_count = 11
y_count = 11
final_size = (in_size * x_count, in_size * y_count)
final_out = Image.new(mode = "I", size = final_size)
for x in range(0, x_count + 1):
for y in range(0, y_count + 1):
filename = "Map_x" + str(x) + "_y" + str(y) + ".png"
with Image.open(filename) as im:
print(filename)
final_out.paste(im, (x * in_size, y * in_size))
print("Final Size: " + str(final_size))
final_out.save("Final Output.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment