<reponame>Thanduriel/NeuralTurbulence
import numpy as np
from PIL import Image

def arrayToImgFile(obj, path):
	obj = obj.T
	min = np.min(obj)
	max = np.max(obj)
	obj = (obj - min) / (max-min)
	obj = (np.clip(obj, 0.0, 1.0) * 255).astype(np.uint8)
	Image.fromarray(obj).convert("L").save(path)
import numpy as np
from PIL import Image

def arrayToImgFile(obj, path):
	obj = obj.T
	min = np.min(obj)
	max = np.max(obj)
	obj = (obj - min) / (max-min)
	obj = (np.clip(obj, 0.0, 1.0) * 255).astype(np.uint8)
	Image.fromarray(obj).convert("L").save(path)