noise

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlendingNoiseToImage

func BlendingNoiseToImage(img image.Image, alpha float64, noiseType string) image.Image

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

func NoiseGenerator(width, height int) image.Image

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

func NoiseGeneratorColor(width, height int) image.Image

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

func NoiseGeneratorGrayScale(width, height int) image.Image

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.

Jump to

Keyboard shortcuts

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