How do you serve retina image when

…the image is inserted in the content of a rich editor for instance?

I’d like to be able to server x1 and x2 image from the content updated by my client inside a rich tetx editor.
Is that possible?

Take a look at the srcset attribute. For example

<img
    src="header-illustration-reduced.png"
    srcset="header-illustration-reduced.png,header-illustration-reduced@2x.png 2x" />

yes thanks @daft I know this srcset but how to integrate that automatically with the media image?
I have a media in a backend form that allows my client to select an image.