Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlendingNoiseToImage ¶
BlendingNoiseToImage applies a noise effect to an image by blending the original image with a generated noise pattern.
Parameters:
- img: The input image to which noise will be applied
- alpha: The blending factor, ranging from 0 to 1. Higher values preserve more of the original image, while lower values add more noise
- noiseType: The type of noise to generate and apply:
- "gray": Grayscale noise (same intensity across R,G,B channels)
- "color": RGB color noise with random values in each channel
- any other value: Default noise pattern
Returns:
- image.Image
The function uses parallel processing to efficiently apply the noise effect.
func NoiseGenerator ¶
NoiseGenerator generates a black and white (binary) noise image. Each pixel is determined by comparing the luminance of random RGB values against a 50% threshold, resulting in either black (0) or white (255) pixels.
Parameters:
- width: The width of the image in pixels
- height: The height of the image in pixels
Returns:
- image.Image
func NoiseGeneratorColor ¶
NoiseGeneratorColor generates a random color noise image where each pixel has random RGB values. The generated image uses the RGBA64 color model with full opacity (alpha = 65535).
Parameters:
- width: The width of the image in pixels
- height: The height of the image in pixels
Returns:
- image.Image
func NoiseGeneratorGrayScale ¶
NoiseGeneratorGrayScale generates a grayscale noise image with continuous tones. Each pixel's value is determined by calculating the luminance of random RGB values, creating a full range of gray shades from black to white.
Parameters:
- width: The width of the image in pixels
- height: The height of the image in pixels
Returns:
- image.Image
Types ¶
This section is empty.