Skip to content

Documentation of Bilateral-blur default intensity sigma #143

Description

@snibgo

ImageMagick version

7.1.2-2

Operating system

Windows

Operating system, version and so on

Windows 11

Description

https://imagemagick.org/command-line-options/#update&gsc.tab=0 says:

The default value for the intensity and spatial sigmas are 0.75*diameter and 0.25*diameter respectively.

However, the code in MagickWand/mogrify.c and MagickWand/operation.c has the default for intensity at 1.0*diameter.

We can demonstrate that the factor used is 1.0. Note that width=10 and height=10 makes diameter=14.14, and 75% of that is 10.6.

D:\temp>%IMG7%magick toes.png -bilateral-blur 10x10 x0.png

D:\temp>%IMG7%magick toes.png -bilateral-blur 10x10+14.14 x14.png

D:\temp>%IMG7%magick toes.png -bilateral-blur 10x10+10.6 x10.png

D:\temp>%IMG7%magick compare -metric RMSE x0.png x14.png NULL:
0.286713 (4.37495e-06)
D:\temp>%IMG7%magick compare -metric RMSE x0.png x10.png NULL:
235.779 (0.00359775)

So the default is very close to the explicit intensity 14.14, which is diameter*1.0.

Looking at "blame" for the source code, the factor has always been 1.0. Thus I suggest the documentation is changed to match the code:

The default value for the intensity and spatial sigmas are 1.0*diameter and 0.25*diameter respectively.

Steps to Reproduce

See above.

Images

Image

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