Load data files relative to script path

This commit is contained in:
kris 2021-11-27 10:43:41 +00:00
parent a2b67ba882
commit ccbb6980d9
2 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,9 @@ import image as image_py
def convert(screen, rgb: np.ndarray, args):
# Conversion matrix from RGB to CAM16UCS colour values. Indexed by
# 24-bit RGB value
rgb24_to_cam16ucs = np.load("data/rgb24_to_cam16ucs.npy")
base_dir = os.path.dirname(__file__)
rgb24_to_cam16ucs = np.load(
os.path.join(base_dir, "data/rgb24_to_cam16ucs.npy"))
dither = dither_pattern.PATTERNS[args.dither]()
bitmap = dither_dhr_pyx.dither_image(

View File

@ -358,8 +358,11 @@ class ClusterPalette:
def convert(screen, rgb: np.ndarray, args):
# Conversion matrix from RGB to CAM16UCS colour values. Indexed by
# 24-bit RGB value
rgb24_to_cam16ucs = np.load("data/rgb24_to_cam16ucs.npy")
rgb12_iigs_to_cam16ucs = np.load("data/rgb12_iigs_to_cam16ucs.npy")
base_dir = os.path.dirname(__file__)
rgb24_to_cam16ucs = np.load(
os.path.join(base_dir, "data/rgb24_to_cam16ucs.npy"))
rgb12_iigs_to_cam16ucs = np.load(
os.path.join(base_dir, "data/rgb12_iigs_to_cam16ucs.npy"))
# TODO: flags
inner_iterations = 10