Simulate-Correct-ColorBlindness
Simulate-Correct-ColorBlindness copied to clipboard
Collapse when correcting images with alpha channel
I am so grateful for your excellent work! However, the program collapses when I tried to correct an image with alpha channel.
Solution: Alpha channel should be ignored when reading an image.
class Utils:
"""
Couple of utils for loading the images.
"""
@staticmethod
def load_rgb(path):
img_rgb = np.array(Image.open(path)) / 255
return img_rgb # Here should be img_rgb[:,:,:3] like in load_lms()
@staticmethod
def load_lms(path):
img_rgb = np.array(Image.open(path)) / 255
img_lms = np.dot(img_rgb[:,:,:3], Transforms.rgb_to_lms())
return img_lms