Dither Mask
The image stays sharp; what you paint shows as a stipple of the accent over it, its edge marching dots the way a selection's ants march, and a ring of dots shows the brush. There's a brush and an eraser, a size you can change with [ and ], undo with Cmd/Ctrl+Z, and B and E to switch tools. After each stroke you get the mask back at the image's own size, white where it's selected, ready to send with an inpainting prompt.
Needs: None. Canvas 2D. You send the mask and the prompt to your image model.
Demo photo by Kenneth Thewissen on Unsplash
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | required | The image to mask. |
| alt | string | required | What it shows, for screen readers. |
| brush | number | 36 | The brush's diameter in px at first. |
| onChange | (mask: MaskResult) => void | – | Called after each stroke, undo or clear: share selected, toCanvas, toBlob. |
| tone | string | – | The selection's colour. The page's accent by default. |
| cell | number | 4 | Size of one mask cell in px. |
| className | string | – | Class on the editor. |
| style | CSSProperties | – | Style on the editor. |