How do I clip an image using a mask?
Example:
Source Image:
Mask Image:
Result Image:
I need to only "draw/fill" from the source image the black part in the mask image.
I know I've done it before but just can't seem to remember or figure it out again...
feeling pretty dumb at the moment.
Any help is much appreciated.
Pretty sure I would use something like this:
developer.mozilla.org
Thanks for reading 🙂
Example:
Source Image:
Mask Image:
Result Image:
I need to only "draw/fill" from the source image the black part in the mask image.
I know I've done it before but just can't seem to remember or figure it out again...
feeling pretty dumb at the moment.
Any help is much appreciated.
Pretty sure I would use something like this:
CanvasRenderingContext2D: globalCompositeOperation property - Web APIs | MDN
The CanvasRenderingContext2D.globalCompositeOperation property of the Canvas 2D API sets the type of compositing operation to apply when drawing new shapes.
Thanks for reading 🙂