问题
I'm facing a problem with the Canvas clip function.
I got the coordinates of the border of the first star on the following picture, but when I clip along the coordinates and then erase the rest I am left with some whitespaces around the star. Some edges like the bottom right ones work fine, but the others don't.
I checked the coordinates by hand via Gimp and they're perfectly aligned along the border (clip border is running on the white pixels touching the outter black border)
Coordinates Array
The result looks like this. I just can't understand why some edges don't contain any whitespaces but others do. This totally confuses me on how to use the clip function.
What am I doing wrong? Do i need to work diagonally instead of always left/right up/down?
来源:https://stackoverflow.com/questions/61123327/nodejs-canvas-clip-region-not-accurate-random-whitespaces-along-edges