3 ms·
You could just render to a blank hidden canvas to grab the mask. Canvases dont need to actually be displayed to be used for computational stuff.
by goldenkey 8y ago
You could just render to a blank hidden canvas to grab the mask. Canvases dont need to actually be displayed to be used for computational stuff.
- Kagerjay 8y agoahhh right just get `fillStyle` or `strokeStyle` or `fill` or `stroke` to nothing. What about making the mask though? Is it kind of like in photoshop where you write some text → create outline / curves off of it? Or do you keep it as text?
- goldenkey 8y agoDepends what you want to do. If you want the mask as a bunch of pixel locations you can loop through the image and make a JS Set of x,y coords which arent blank. I am not sure what representations the above app used for their masks. It's all isomorphic. Important step is just to generate the masks using either fillText or strokeText.