Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur filter: radius to sigma conversion is not clear #71

Open
tinchodias opened this issue Nov 28, 2024 · 1 comment
Open

Blur filter: radius to sigma conversion is not clear #71

tinchodias opened this issue Nov 28, 2024 · 1 comment

Comments

@tinchodias
Copy link
Contributor

Our AeCairoA8FastGaussianBlurFilter adapts a blur algorithm that takes "sigma" as parameter to indicate the level of blur to apply (greater sigma means more blur). Now, our implementation takes a "blur radius" as parameter, which immediately converts to sigma multiplying radius by a factor.

It should be possible to pass sigma directly as parameter. For example, in SVG's blur (feGaussianBlur), you specify sigma directly.

Additionally, the factor we use to convert from radius to sigma is not well justified:

"See: https://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement"
GaussianScaleFactor := (3 * (Float twoPi sqrt) / 4) * 1.5

Sadly, besides I wrote this code, I don't remember the origin of the formula for this conversion factor. The spec referenced by the URL doesn't clarify enough, or in any case the code uses 1.5 while spec has 0.5.

@tinchodias
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant