Plasma fractal (Diamond-Square) pattern varies brightness and contrast spatially. brightness_range, contrast_range. Organic, non-uniform look.
Uses Diamond-Square algorithm to generate organic-looking fractal patterns that create spatially-varying brightness and contrast adjustments.
brightness_rangeRange for brightness adjustment strength. Values between -1 and 1:
contrast_rangeRange for contrast adjustment strength. Values between -1 and 1:
plasma_sizeSize of the initial plasma pattern grid. Larger values create more detailed patterns but are slower to compute. The pattern will be resized to match the input image dimensions. Default: 256
roughnessControls how quickly the noise amplitude increases at each iteration. Must be greater than 0:
pProbability of applying the transform. Default: 0.5.
>>> import albumentations as A
>>> import numpy as np
# Default parameters
>>> transform = A.PlasmaBrightnessContrast(p=1.0)
# Custom adjustments
>>> transform = A.PlasmaBrightnessContrast(
... brightness_range=(-0.5, 0.5),
... contrast_range=(-0.3, 0.3),
... plasma_size=512, # More detailed pattern
... roughness=0.7, # Smoother transitions
... p=1.0
... )