Hei, if someone wants to implement this, feel free to contribute this to my Phomemo M02 (a cheap < 15$) black and white thermal printer, web app.

https://github.com/K0IN/Phomemo-M02-Web

Since I see you're using Vue, I created an MIT licensed dithering web app with Vue. I've never tried to embed it in anything, but you're welcome to give it a shot.

https://github.com/allen-garvey/dithermark