Zoomed region of arbitrary shape

Dear Community,
I have a 2D image in the figure, which is created by Plotly Express: fig = px.imshow(frame). Then it is passed to dcc.Graph and I see it in my web page.
I need to select the region of this image, and use the Zoom functionality for this, by clicking and dragging the mouse. But, the aspect ratio of the selected region is always the same as the aspect ratio of the original image. I need to be able to select the region of arbitrary shape, e.g. I would like to select square region in the rectangular image.
Could you please advise if this is possible? How can I achieve this? Are there any parameters which I can set, so the keeping of aspect ratio of the zoomed region is disabeled?
Thank you!