More work on automatic map creation

This commit is contained in:
Davide Passoni
2024-02-22 17:46:34 +01:00
parent 14679bd7d8
commit acb55044d1
13 changed files with 408 additions and 80 deletions

View File

@@ -1,12 +1,20 @@
import os
from PIL import Image
import concurrent.futures
import math
# correction parameters
# NTTR
rotation = math.degrees(0.01895)
scale = 0.973384
zoom = 16
path = "output"
def crop_image(filename):
img = Image.open(os.path.join(path, filename))
img = Image.open(os.path.join(path, filename)).rotate(-rotation)
img = img.resize((math.floor(img.width * scale), math.floor(img.height * scale)))
center_X, center_Y = filename.removesuffix(".png").split("_")
center_X = int(center_X)
center_Y = int(center_Y)