Open emmanuelle opened 4 years ago
this would mean adding a colormodel
attribute in px.imshow
, corresponding tests in https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/tests/test_core/test_px/test_imshow.py, and an example in the documentation (which could be inspired by https://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_rgb_to_hsv.html)
@emmanuelle I am interested to work on it.
To be clear, 1) Should the tests be updated? It seems like no tests were written for colormodel. 2) colormodel includes ['rgb', 'rgba', 'rgba256', 'hsl', 'hsla'], should all of these be considered?
Thanks!
Hi @liudj2008 thank you very much :-). My idea was to add a colormodel
argument to px.imshow
which could be either rgb
or hsl
; handling transparency can be done automatically depending on the number of channels of the image array, as done in https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/express/_imshow.py#L433
One test could be added to check that the colormodel argument is used in the specification in the plotly Figure. Indeed, there are no tests yet related to colormodel.
Hi @emmanuelle , there are two errors occurred during checks: plotlyjs_dev_build and build-doc. Not sure what happened there. Could you help me take a look? Thanks!
Here is the RP link: https://github.com/plotly/plotly.py/pull/2833
I just discovered that
go.Image
has acolormodel
attributes, which makes it possible in particular to support hsl values. It'd be nice to support this in px.imshow as well.