Images that copy code to clipboard when you click on them

I think that clipboard.js is your best bet to what you’re looking for.

Install that script, then just change your img to

<img src="https://wordpress.stackexchange.com/questions/328613/..." data-clipboard-text="https://wordpress.stackexchange.com/questions/328613/...">

And you should be good to go.