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

Brightness/Contrast adjustment crashes and close the software #197

Open
maulakhan opened this issue Nov 6, 2024 · 0 comments
Open

Brightness/Contrast adjustment crashes and close the software #197

maulakhan opened this issue Nov 6, 2024 · 0 comments

Comments

@maulakhan
Copy link

Hello,

We have been using anylabeling for doing polygonal image labeling. Our images are grayscale, single channel, 16-bit tiff images created by "tifffile" python library. It works great and its very user friendly. However, we are facing an issue that whenever we try to do brightness/contrast adjustment using the GUI, it crashes and closes the software. On windows, we get this error in the terminal window:

Traceback (most recent call last):
  File "C:\Users\joker\Miniconda3\envs\anylabeling\Lib\site-packages\anylabeling\views\labeling\widgets\brightness_contrast_dialog.py", line 37, in on_new_value
    img = PIL.ImageEnhance.Brightness(img).enhance(brightness)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\joker\Miniconda3\envs\anylabeling\Lib\site-packages\PIL\ImageEnhance.py", line 40, in enhance
    return Image.blend(self.degenerate, self.image, factor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\joker\Miniconda3\envs\anylabeling\Lib\site-packages\PIL\Image.py", line 3540, in blend
    return im1._new(core.blend(im1.im, im2.im, alpha))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: image has wrong mode

Can you please help us to understand how we can use this function correctly, so that it doesn't crash.

Thank you very much

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