I've tried! Calling insertText
when the rich text editor is open doesn't seem to work with SVG images (it's inserting part of the image as text. I'll have to look into this further...). Programmatically switching to the markdown editor, then calling insertText, and switching back to the rich text editor is something that might work...
Additionally, I haven't found a way to send messages from the rich text editor's WebView to the main plugin script (webviewApi.postMessage doesn't seem to exist in the rich text editor). As such, I don't know how to get an "edit image" button in the rich text editor to communicate with the main plugin.
I'm so glad this is getting added. It's really a key feature, & the previous work-around (embed an image & edit with an external program) was always cumbersome.
Be aware that Plugin: draw.io and Plugin: support Excalidraw in joplin also exist.