-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Discrepancies in image colour space interpretation. #7
Comments
I can fix it but I want to know your opinion concerning it before opening a PR. |
It would be nice if u can work on this issue. I feel like you are right, rgb conversion should be true by default to avoid the hassle of of type checking. Thank you for pointing out the issue :) |
I would like to hear if you would be interested in fixing the issue :) |
Sure, I am. It doesn't require that much changes, so I'll open a PR as regards this very soon. Also, I realized there'll be no need for an option to specify the colour space of an image... since the 24-bit ANSI codes already use RGB, it makes sense to just convert all images in other colour spaces to RGB. |
ah yes. |
Convert all color spaces to RGB (fixed #7)
Here:
https://github.com/pranavbaburaj/img/blob/1309c087b7b7aa5ade183c2800a0789d1529b6ab/image.py#L73
conversion to RGB is not enabled by default but here:
https://github.com/pranavbaburaj/img/blob/1309c087b7b7aa5ade183c2800a0789d1529b6ab/image.py#L93
RGB values are expected.
I actually ran into this bug while trying to print a PNG image with a single (alpha) chanel. Here: https://github.com/pranavbaburaj/img/blob/1309c087b7b7aa5ade183c2800a0789d1529b6ab/image.py#L83
pixel_values was just a tuple of integers (0s and 1s), representing the opacity of each pixel.
So, here:
https://github.com/pranavbaburaj/img/blob/1309c087b7b7aa5ade183c2800a0789d1529b6ab/image.py#L90-L92
continue
was always executed on every iteration.Therefore, there was no output at all!
As expected, the image could only be displayed when I set
convert_to_rgb = True
when callingdraw_image()
.I think conversion to RGB should be made the default and then support for other colour spaces can be added later on.
The text was updated successfully, but these errors were encountered: