lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

`geom_imshow`: unclear error message when mixing transparencies

Open ASmirnov-HORIS opened this issue 1 year ago • 0 comments

Example:

img_array = np.array([
    [[0, 0, 255, 255], [0, 0, 255, 127]],
    [[255, 0, 0, 127], [255, 0, 0, 255]]
])
ggplot() + geom_imshow(img_array, alpha=.5)

The code throws:

UFuncTypeError: Cannot cast ufunc 'multiply' output from dtype('float64') to dtype('int32') with casting rule 'same_kind'

But the real problem is that we are using the alpha channel in the image and the alpha param of the geom_imshow() function at the same time, and Lets-Plot cannot handle this case.

ASmirnov-HORIS avatar Apr 27 '24 10:04 ASmirnov-HORIS