Skip to content

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

@tinchodias

Description

@tinchodias

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions