blur

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GaussianBlur

func GaussianBlur(img image.Image, level int) image.Image

GaussianBlur applies a Gaussian blur filter to an image, creating a smooth blurring effect. The algorithm uses separable 1D convolutions for horizontal and vertical passes, which is significantly more efficient than a direct 2D convolution. Processing is done in parallel to maximize performance on multi-core systems.

Parameters:

  • img: The source image to be blurred (image.Image interface)
  • level: The blur intensity, ranging from 0 (no blur) to 30 (maximum blur) Higher values create a stronger blur effect but may impact performance

Returns:

  • image.Image: A new image with the blur effect applied

Note: The level parameter is automatically clamped to the valid range [0, 30].

func Median added in v0.3.1

func Median(img image.Image, box int) image.Image

Median applies a median blur filter to an image. The median filter works by replacing each pixel with the median value from its surrounding neighborhood, which effectively removes noise while preserving edges in the image.

Parameters:

  • img: The source image to be processed
  • box: Size of the filter kernel (square matrix), valid range 3-30. Larger values create stronger blurring effects but increase processing time. Values outside this range will be clamped.

Returns:

  • image.Image

Note: The implementation uses parallel execution to improve performance on multi-core systems.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL