Skip to content

support colormodel in px.imshow #2717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emmanuelle opened this issue Aug 19, 2020 · 4 comments
Open

support colormodel in px.imshow #2717

emmanuelle opened this issue Aug 19, 2020 · 4 comments
Labels
feature something new P3 backlog

Comments

@emmanuelle
Copy link
Contributor

I just discovered that go.Image has a colormodel attributes, which makes it possible in particular to support hsl values. It'd be nice to support this in px.imshow as well.

@emmanuelle
Copy link
Contributor Author

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)

@liudj2008
Copy link

@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!

@emmanuelle
Copy link
Contributor Author

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.

@liudj2008
Copy link

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:
#2833

@gvwilson gvwilson self-assigned this Jul 5, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added P3 backlog feature something new labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

4 participants