Skip to content

Collapse when correcting images with alpha channel #7

@Krankheit

Description

@Krankheit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions