Skip to content

Add gaussian noise #381

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

A popular way to train various kinds of generative neural networks is to add gaussian noise to an image and have them restore the original.

Desired solution

  • Method add_gaussian_noise on Image
  • Parameter standard_deviation to adjust the standard deviation of the noise
  • Raise error if standard_deviation is below 0

Possible implementation:

  • Create a new image with the same dimensions as the original containing only the noise:
from PIL import Image as PILImage

img_noise = PILImage.effect_noise((image.width, image.height), standard_deviation)
  • Blend it with the original image using Image.blend

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions