I don't know if it's exactly what you're looking for but I made a free tool https://app.dithermark.com . It only allows 18 colors max, but it has a lot of options, including the ability to determine what color palette to use.
Color dithering is very similar black and white dithering, the difference is that instead of 2 colors (black and white), you have n colors, and you want to find the one that has the shortest distance to the current pixel. There are various formulas[1] to determine which color is closest, and which formula you choose will have an effect on the results. I built a dithering app[2] that lets you choose the distance formula, so you can see for yourself.
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.
The Bug by Ellen Ullman
Radicalized by Corey Doctrow
Valuable Humans in Transit and Other Stories by qntm