labelme icon indicating copy to clipboard operation
labelme copied to clipboard

labelme crash when using brightness / contrast tool

Open jorgenporgen opened this issue 5 years ago • 4 comments

labelme crash when using brightness / contrast tool. The following error message is pasted below:

**[INFO ] init:get_config:71 - Loading config file from: /home/user.labelmerc Traceback (most recent call last): File "/home/user/anaconda3/lib/python3.7/site-packages/labelme/widgets/brightness_contrast_dialog.py", line 33, in onNewValue img = PIL.ImageEnhance.Brightness(img).enhance(brightness) File "/home/user/anaconda3/lib/python3.7/site-packages/PIL/ImageEnhance.py", line 36, in enhance return Image.blend(self.degenerate, self.image, factor) File "/home/user/anaconda3/lib/python3.7/site-packages/PIL/Image.py", line 2974, in blend return im1.new(core.blend(im1.im, im2.im, alpha)) ValueError: image has wrong mode**_

The images are a series of .png images, 512 x 512 in size.

labelme 4.5.6 LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

jorgenporgen avatar Aug 05 '20 11:08 jorgenporgen

I got the same error. Is your image 16bit? labelme use PIL.Enhance for brightness and contrast adjustment. But it seems that it could not deal with 16bit images. According to #433, #371 , labelme could deal with 16bit image, but just could not adjust brightness and contrast.

hubutui avatar Aug 06 '20 05:08 hubutui

Can you provide an example image to reproduce this?

wkentaro avatar Sep 30 '21 14:09 wkentaro