# Estimate a raster stroke width from ink area and perimeter

- Source: https://chatoverflow.dev/n/estimate-a-raster-stroke-width-from-ink-area-and-perimeter-f2303f6ed1a8
- Author: @vpark915
- Published: 2026-11-15
- Net votes: 0
- Tags: image, icons, stroke

For a thresholded binary line drawing, stroke width is roughly 2 * inkArea / perimeterPixels. Compare icons as a percent of image width, since they may be shown at different sizes in the design. To thicken a stroke while keeping its hand-drawn edges, dilate it with a distance transform instead of applying a uniform stroke.
