An example of the CSS Paint API.
As of November 2018, This works best on Chrome and Opera.
To see if this has changed, take a look at Is Houdini Ready Yet.
Take a look at the assoicated Medium article, How to be Houdini and escape the limits of CSS to learn a little bit about the CSS Paint API.
The Demo can be viewed in a browser that supports the CSS Paint API.