def upscale_texture(img, scale_factor): img = img.resize((img.width * scale_factor, img.height * scale_factor), Image.LANCZOS) return img