Closed 1Euro7Cent closed 2 years ago
Had this issue too, it looks like the documentation is incorrect and the options should be given in the following way:
const options = {
"step": 1, // The step for the pixel quantization n = 1,2,3...
//"palette": defaultPalette, // an array of colors as rgb arrays
"algorithm": "diffusion" // one of ["ordered", "diffusion", "atkinson"]
};
const ditherjs = new DitherJS(options);
ditherjs.dither('img', options); // should target <img> elements
I already fixed it by looking into the source code. I forgot about this issue existing. But thank you.
I've made the example stuff
the color array: err:
additional information: windows 10 pro 64bit
node: v14.16.0 npm: 6.14.11
Did I make anything wrong?