HeadlinesBriefing favicon HeadlinesBriefing.com

Painting with Gaussians: Edge-Aware Digital Brushwork

Hacker News •
×

Last year I built an edge‑aware pixelation tool that deforms a grid to follow image edges, keeping details crisp. I realized the same edge data could guide a digital painting program, determining where brush strokes go, how big they are, and their direction.

A brush stroke is an elongated mark that fades at its edges, and a 2D Gaussian splat maps onto this idea: its mean is the stroke’s center, its covariance encodes elongation and rotation, and its color and opacity blend naturally with an over‑compositing operator. Unlike slow gradient‑descent approaches, I seed splats directly from the image, using edge information to avoid the lossy reconstruction of the input.

To capture orientation I compute a structure tensor from image gradients; the eigenvectors give the stroke direction and coherence. To handle color edges, I replace the luminance tensor with the Di Zenzo color tensor, which combines RGB gradients. This technique, inspired by Litwinowicz and Hertzmann, yields thin, directional strokes along contours while keeping flat areas round.

However, edge strength alone cannot dictate stroke density. Texture‑rich regions like gravel need many fine marks, whereas smooth skin requires broad strokes. A density map derived from texture cues is therefore essential for realistic painterly rendering.