I just read StackExchange blog It’s OK to Ask and Answer Your Own Questions which even encourages it and decided to ask about a problem I now know how to solve. But I found an elegant answer only recently (and will post it now below), much inspired by this very site and answers I'm trying to understand.
Q: I would like to round the corners of an image into circular arcs of some radius before I upload it to a blog.
Test image:

