Skip to content

Add webp support to px.imshow #4797

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
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add doc example for imshow binary_backend_kwargs
Signed-off-by: maximsmol <[email protected]>
  • Loading branch information
maximsmol committed Oct 11, 2024
commit 325057d0cd735ad77e94de6bc77807e8fc489fc3
13 changes: 13 additions & 0 deletions doc/python/imshow.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ fig = px.imshow(img, binary_format="jpeg", binary_compression_level=0)
fig.show()
```

```python
import plotly.express as px
from skimage import data
img = data.astronaut()
fig = px.imshow(
img,
# Pillow backend parameters are documented here: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#webp
# Available parameters depend on the `binary_format`
binary_backend_kwargs={"lossless": False}
)
fig.show()
```

### Display single-channel 2D data as a heatmap

For a 2D image, `px.imshow` uses a colorscale to map scalar data to colors. The default colorscale is the one of the active template (see [the tutorial on templates](/python/templates/)).
Expand Down