Downloaded image is not pixelated correctly

Hi everyone,

I have a confusing issue on my dash app. When I download a heatmap, the pixels are represented with interpolated boundaries; to be more clear:

in-app, the view is:
Screenshot from 2021-12-02 15-10-55

while the downloaded image is blurred (either downloaded by the default download button or by a custom button employing caleido:

format_image = 'svg'
img_bytes = img.to_image(format=f'{format_image}', engine="kaleido")
print(f'Download initiated.')
return dcc.send_bytes(img_bytes, filename=f'image.{format_image}')


Obtaining something like this:

This behaviour seems to be built-in (it looks like the program is traing to smooth the pixel boundaries), because the same effect is obtained by downloading a heatmap from the dash website itself.

I hope that I explained myself…

Thank you all in advance