fossasia/visdom

Adding support for alpha channels

Closed

#694 opened on Jan 2, 2020

 (4 comments) (0 reactions) (0 assignees)Python (1,152 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (9,831 stars)
PR merge metrics
 (Avg merge 9d 12h) (116 merged PRs in 30d)

Description

Currently, this project supports displaying greyscale and RGB images. However, many digital images also contain an alpha channel, and it would be nice to display images as RGBA, rather than converting them to RGB.

My initial investigation shows that simply changing the depth of the first axis from 3 to 4 in https://github.com/facebookresearch/visdom/blob/master/py/visdom/__init__.py#L1268 allows for proper display of RGBA images. Grayscale and RGB images would need to be converted to RGBA by adding a 'full' alpha channel.

Changing only the line as described above, and setting the background of the windows to green gives the following result: image

Contributor guide