Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse when correcting images with alpha channel #7

Open
Krankheit opened this issue May 9, 2023 · 0 comments
Open

Collapse when correcting images with alpha channel #7

Krankheit opened this issue May 9, 2023 · 0 comments

Comments

@Krankheit
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant