Halftone
Targets:
image
Image Types:uint8, float32
Halftone dot pattern (printing-style). Continuous tones become dots of varying size. Use for vintage or print-aesthetic augmentation.
Simulates halftone printing: a grid of cells, each drawn as a filled circle whose size is proportional to mean luminance in that cell. Larger dots = brighter, smaller = darker. Optional blend with the original image controls strength.
Arguments
dot_size_rangetuple[int, int]
[4,10]
Range for grid cell size in pixels. Larger = coarser pattern. Default: (4, 10).
blend_rangetuple[float, float]
[0,0.5]
Blend with original: 0 = pure halftone, 1 = original. Default: (0.0, 0.5).
pfloat
0.5
Probability of applying the transform. Default: 0.5.
Examples
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
>>>
>>> transform = A.Halftone(dot_size_range=(4, 8), blend_range=(0.0, 0.3), p=1.0)
>>> result = transform(image=image)["image"]Notes
- Mean luminance per grid cell drives dot radius; cell color from original image.
- Dot size is proportional to luminance (bright → large dot, dark → small dot).
See Also
- FilmGrain: Luminance-dependent film grain for vintage texture.
- Vignetting: Darkened edges for period or stylistic effect.