Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

Frosted Glass effect: add Smoothness parameter

Open cameronwhite opened this issue 11 months ago • 1 comments

From #1229, this parameter exists in Paint.NET and applies antialiasing to the displaced pixels

Image

cameronwhite avatar Jan 26 '25 00:01 cameronwhite

Looking at this more closely, Pinta's implementation has some differences from the reference PDN implementation dating back to the original port

In PDN, it just randomly samples a pixel within the min/max radius range to produce the scattering effect, and then the number of samples controls the smoothness. In newer versions there is also a diffusion parameter, which from what I can tell controls a bias function to e.g. move more of the samples closer to the max radius, or vice versa

In the Pinta version it computes the luminance / intensity of every pixel in the neighbourhood (a square block of size Amount), then randomly picks a pixel. The result is then the blended value of all the pixels which had that same intensity.

Because of this you might get a sharper or smoother result depending on the intensity values in the local region. I'm also not really clear on why this approach makes more sense than the original PDN implementation - I'd be curious to hear others' thoughts on this? It's also likely more expensive since it always has to traverse the entire NxN local region for each pixel

We definitely could still add a smoothness parameter which blends between some additional samples, though.

cameronwhite avatar Aug 04 '25 02:08 cameronwhite