Is it possible to save a (cropped) image of just the plot area?

Is it possible to save a (cropped) image of just the plot area? E.g. using Plotly.toImage.

Ideally what I’d like to do is allow the user to draw objects (which is fine using e.g. ‘drawline’ in the mode bar add ons) and be able to write this to an image file / array. (I then use this for simulating a physics model which gets drawn after calculating, so I’d like to keep it all in plotly).