diff --git a/convert_dhr.py b/convert_dhr.py index c769bdf..6e2d5df 100644 --- a/convert_dhr.py +++ b/convert_dhr.py @@ -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( diff --git a/convert_shr.py b/convert_shr.py index 5db67f6..40e955a 100644 --- a/convert_shr.py +++ b/convert_shr.py @@ -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