Fuzzy plotting of image when using mapbox_layers in scatter_mapbox

Hi all!

I am trying to plot a raster above a base image in python using plotly 5.15.0 and datashader 0.16.0. Everything looks fine in the first moment, but when I zoom into the html, then the raster pixels are displayed somehow fuzzy.

My workflow is:

  1. Create a PIL using datashader and transfer_functions.shade().to_pil()
  2. plotting a Placeholder scatter_maxbox fig = px.scatter_mapbox(...)
  3. adding the PIL by using mapbox_layers:
fig.update_layout(mapbox_style="carto-positron",
                               mapbox_layers =[
                      {
                        "sourcetype": "image",
                        "source": img_out,
                        "coordinates": bbox,
                        "opacity":1,
                        "type": "raster",
                      }]
  1. saving the html with fig.write_html(f"./plots/{plot_name}.html")

Here is an example of a zoommed pixel displaying the fuzziness. I would expect that there is a sharp rectangle but instead it is a fuzzy circle/point.

Does anyone has experience with this issue?