Can I create a ground from height map that uses a canvas toDataUrl?

I’m trying to generate a heightmap from an html canvas. I haven’t been able to get the heightmap working yet

Playground example

I saw that there was another similar topic using URL.createObjectURL which doesn’t seem to be working for me (comment line 48 and uncomment lines 51-52 to try it).

Is it possible to use a data stream instead of an url to create a heightmap?

You should give a higher value to subdivisions (it’s 1 by default):