fossasia/visdom

Adding support for alpha channels

Chiusa

#694 aperta il 2 gen 2020

 (4 commenti) (0 reazioni) (0 assegnatari)Python (1152 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (9831 stelle)
Metriche merge PR
 (Merge medio 9g 12h) (116 PR mergiate in 30 g)

Descrizione

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

Guida contributor