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
Allow 1 mode images to be inverted #6034
Conversation
Is this always correct? My special case used the shortcut that if you interpret a 1-bit image as a 8-bit image and apply a linear inverse 8-bit lut on it then it is equivalent to inverting each bit. But this is not valid for a general lut. How exactly does image.point() work for a 1 - bit image? |
I'm not sure there's any point to autocontrast, equalize, posterize or solarize on 1 bit images. They're just fundamentally not 1 bit operations. |
In terms of the code, it is simpler to support those operations than to exclude them. |
I'm not following this part of your question. It works in the same way that it does for an L mode image. A 1 mode image just happens to only have 0 and 255 values, and nothing in the middle. |
Yes, but those operations aren't properly defined for 1 bit images. It's valid for invert, but that's it. You're getting the same image back in the other cases (except for solarize). I think it's wrong to attempt these other transforms on a 1 bit image. |
Ok, I've removed support for the other operations. |
Great! I just tested and your (On a C level |
Allows
autocontrast
,equalize
,invert
,posterize
andsolarize
to support 1 mode images.Alternative to #6033