HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / AI

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

PropTypeDefaultDescription
srcstringrequiredThe image to mask.
altstringrequiredWhat it shows, for screen readers.
brushnumber36The brush's diameter in px at first.
onChange(mask: MaskResult) => void–Called after each stroke, undo or clear: share selected, toCanvas, toBlob.
tonestring–The selection's colour. The page's accent by default.
cellnumber4Size of one mask cell in px.
classNamestring–Class on the editor.
styleCSSProperties–Style on the editor.
← Diffusion TextDoc Reader →