magickBilateralBlurImage method

Future<bool> magickBilateralBlurImage({
  1. required double radius,
  2. required double sigma,
  3. required double intensitySigma,
  4. required double spatialSigma,
})

magickBilateralBlurImage() is a non-linear, edge-preserving, and noise-reducing smoothing filter for images. It replaces the intensity of each pixel with a weighted average of intensity values from nearby pixels. This weight is based on a Gaussian distribution. The weights depend not only on Euclidean distance of pixels, but also on the radiometric differences (e.g., range differences, such as color intensity, depth distance, etc.). This preserves sharp edges.

This method runs inside an isolate different from the main isolate.

  • radius : the radius of the Gaussian, in pixels, not counting the center pixel.
  • sigma : the standard deviation of the , in pixels.
  • intensity_sigma : sigma in the intensity space. A larger value means that farther colors within the pixel neighborhood (see spatial_sigma) will be mixed together, resulting in larger areas of semi-equal color.
  • spatial_sigma : sigma in the coordinate space. A larger value means that farther pixels influence each other as long as their colors are close enough (see intensity_sigma ). When the neighborhood diameter is greater than zero, it specifies the neighborhood size regardless of spatial_sigma. Otherwise, the neighborhood diameter is proportional to spatial_sigma.

Implementation

Future<bool> magickBilateralBlurImage({
  required double radius,
  required double sigma,
  required double intensitySigma,
  required double spatialSigma,
}) async =>
    await _magickCompute(
      _magickBilateralBlurImage,
      _MagickBilateralBlurImageParams(
        _wandPtr.address,
        radius,
        sigma,
        intensitySigma,
        spatialSigma,
      ),
    );