All Transforms (127)
Browse all Albumentations image augmentation transforms with descriptions and supported targets.
Image-Only Transforms
(67)Transforms that modify only pixel data without affecting annotations.
AdditiveNoise
Random noise to channels: uniform, gaussian, laplace, or beta. spatial_mode: constant, per_pixel, or shared. Params depend on noise_type.
AdvancedBlur
Blur with a generalized Gaussian kernel (shape from beta), optional anisotropy and rotation, plus kernel noise. Broader effect range than GaussianBlur.
AtmosphericFog
Add depth-dependent fog via the atmospheric scattering equation and a synthetic depth map. Use for outdoor and driving robustness to haze.
AutoContrast
Stretch intensity to full range (autocontrast). method: CDF or PIL-style. cutoff, ignore trim extremes. Use for normalizing brightness/contrast across images.
Blur
Average pixels over a random square kernel (box filter). Fast, soft blur; kernel size from blur_limit. Good for mild smoothing or augmentation variety.
CLAHE
Contrast Limited Adaptive Histogram Equalization: local contrast with clip_limit and tile_grid_size. Good for non-uniform lighting; preserves detail.
ChannelDropout
Randomly drop channels. channel_drop_range, fill. Replaces selected channels with fill; improves robustness to missing channels. Image-only.
ChannelShuffle
Permute image channels. By default the permutation is random (uniform over all orderings); set `channel_order` to pin a fixed reordering.
ChannelSwap
Fixed channel reordering (e.g. RGB->BGR). Convenience subclass of `ChannelShuffle` with a required `channel_order` argument.
ChromaticAberration
Add lateral chromatic aberration: shift red and blue relative to green. distortion_limit and shift_limit control strength. Simulates lens color fringing.
ColorJitter
Randomly apply brightness, contrast, saturation, hue in random order. Separate ranges per effect. Strong color augmentation for classification and detection.
Defocus
Simulate out-of-focus lens: disc-shaped kernel (aperture) plus optional Gaussian alias blur. Radius and alias_blur control strength and edge softness.
Dithering
Reduce colors via dithering: ordered Bayer, error diffusion, or random. num_levels, method. Good for retro look or limited-color output.
Downscale
Reduce quality by downscale then upscale. scale_min and scale_max control factor. Simulates resolution or compression loss.
Emboss
Apply emboss effect (directional highlight and shadow). strength_range controls intensity. Pseudo-3D look; for texture or style augmentation.
Equalize
Equalize histogram to spread intensities. mode: global or adaptive; mask optional. Improves contrast normalization across datasets.
FDA
Fourier Domain Adaptation: swap low-frequency spectrum with reference (metadata_key). beta_limit controls extent. Good for unsupervised domain adaptation (UDA).
FancyPCA
Add color variation via PCA on RGB: perturb components by alpha_std. Simulates natural lighting variation (ImageNet-style). Good for object recognition.
FilmGrain
Analog film grain: luminance-dependent, spatially correlated noise. Distinct from i.i.d. GaussNoise or ShotNoise. Use for vintage or film-like augmentation.
FromFloat
Convert image from float [0, 1] to discrete type (e.g. uint8 [0, 255]). Inverse of ToFloat. max_value and dtype control scaling and output type.
GaussNoise
Add Gaussian (normal) noise to the image. i.i.d. per pixel (or per block if scaled). Use for robustness to sensor or transmission noise.
GaussianBlur
Smooth the image with a Gaussian kernel (weighted average; reduces noise and fine detail). Kernel size and sigma are sampled randomly per call.
GlassBlur
Simulate frosted glass: Gaussian blur then local random pixel shuffles. Controlled by sigma (blur), max_delta (shuffle distance), and iterations.
HEStain
H&E stain augmentation for histopathology. method: preset, random_preset, vahadane, macenko. Simulates staining variation for robust pathology models.
Halftone
Halftone dot pattern (printing-style). Continuous tones become dots of varying size. Use for vintage or print-aesthetic augmentation.
HistogramMatching
Match input histogram to a reference image (metadata_key). Aligns intensity and contrast; blend_ratio controls strength. Good for cross-domain style alignment.
HueSaturationValue
Randomly shift hue, saturation, and value (HSV). Separate ranges per channel. Common for color augmentation in classification.
ISONoise
Add camera-sensor-like noise scaling with intensity (high ISO). color_shift and intensity range control strength. Good for low-light or camera noise simulation.
Illumination
Illumination patterns: directional (linear), corner shadows/highlights, or gaussian. mode and params control shape and strength. Simulates lighting variation.
ImageCompression
Reduce image quality via JPEG or WebP compression. quality_range and compression_type control strength and format. Simulates real-world compression artifacts.
InvertImg
Invert the input image by subtracting pixel values from max values of the image types, i.e., 255 for uint8 and 1.0 for float32.
LensFlare
Add lens flare: starburst rays and ghost reflections from a bright source. Use for outdoor or backlit robustness and optical-artifact simulation.
MedianBlur
Replace each pixel with median in a square window. Removes salt-and-pepper noise; edges sharper than box or Gaussian. Kernel size from blur_limit.
MotionBlur
Simulate motion blur along a random direction (camera shake or moving subject). Kernel size and angle sampled per call; optional shift for off-center streaks.
MultiplicativeNoise
Multiply image by random per-pixel or per-channel factor. multiplier_range controls strength. Simulates illumination or gain variation; preserves zeros.
Normalize
Applies various normalization techniques to an image. The specific normalization technique can be selected with the `normalization` parameter.
PhotoMetricDistort
SSD-style photometric distortion: brightness, contrast, saturation, hue, channel shuffle; each with probability distort_p. For detection training.
PixelDistributionAdaptation
Adapts the pixel value distribution of an input image to match a reference image using statistical transformations (PCA, StandardScaler, or MinMaxScaler).
PlanckianJitter
Simulate color temperature variation via Planckian locus jitter. mode and magnitude control the shift. Good for robustness to different light sources.
PlasmaBrightnessContrast
Plasma fractal (Diamond-Square) pattern varies brightness and contrast spatially. brightness_range, contrast_range. Organic, non-uniform look.
PlasmaShadow
Plasma fractal (Diamond-Square) shadow: organic darkening. shadow_intensity_range, roughness. Good for natural shading and lighting variation.
Posterize
Reduce bits per color channel (e.g. 8→4). num_bits_range controls strength; lower gives stronger posterization. Simulates low-bit-depth or compression.
RGBShift
Shift R, G, B with separate ranges. Specialized AdditiveNoise with constant uniform shifts. Params: r_shift_limit, g_shift_limit, b_shift_limit.
RandomBrightnessContrast
Randomly adjust brightness and contrast with separate ranges. Simple and fast; good baseline color augmentation for classification and detection.
RandomFog
Simulate fog by overlaying semi-transparent circles and blending with a fog color. Good for driving or outdoor robustness to weather.
RandomGamma
Apply random gamma correction (power-law on intensity). gamma_limit controls range. Common for exposure and display variation.
RandomGravel
Add gravel-like particle artifacts on the image. Number and size of particles and ROI are configurable. Simulates dirt or debris on a lens or surface.
RandomRain
Add rain streaks (semi-transparent lines), optional blur and brightness reduction. Good for outdoor or driving robustness to rainy conditions.
RandomShadow
Simulate cast shadows by darkening random regions. shadow_roi, num_shadows, shadow_dimension control placement and softness. Improves lighting robustness.
RandomSnow
Add snow overlay via bleach (brightness threshold) or texture (noise-based overlay). Good for winter or snowy-scene robustness in outdoor imagery.
RandomSunFlare
Simulate lens flare: circles of light and rays. src_radius, num_flare_circles, angle control the effect. Good for outdoor robustness.
RandomToneCurve
Randomly warp the tone curve to change contrast and tonal distribution. scale and scale_upper control strength. Good for exposure variation.
RingingOvershoot
Create ringing or overshoot artifacts via 2D sinc convolution. blur_limit and cutoff control strength. Simulates sharpening or compression artifacts.
SaltAndPepper
Apply salt-and-pepper (impulse) noise: randomly set pixels to min or max. amount and salt_vs_pepper control density and ratio. Same mask for all channels.
Sharpen
Sharpen the image via kernel or Gaussian unsharp method. alpha and lightness control strength. Enhances edges; useful for document or detail-sensitive tasks.
ShotNoise
Shot noise (Poisson) in linear light space. Sensor-realistic; use for low-light or photon-limited imaging and camera simulation.
Solarize
Invert pixel values above a threshold. threshold_range controls cutoff. Strong highlight inversion; useful for data augmentation.
Spatter
Simulate lens occlusion from rain or mud: splatter patterns and optional blur. fill and spread control appearance. Good for dirty or wet lens robustness.
Superpixels
Replace image with superpixel segmentation (SLIC). p_replace, n_segments, max_size control fraction and segment count. Reduces fine texture.
TextImage
Render text onto images from metadata. font_path, stopwords, augmentations, fraction_range, font_size_fraction_range, font_color, metadata_key, clear_bg.
ToFloat
Convert the input image to float32 in [0, 1] by dividing by max_value. Useful for normalizing before neural networks or algorithms that expect float input.
ToGray
Convert to grayscale (weighted by channel weights). Optionally replicate to keep shape. Useful for grayscale training or channel reduction.
ToRGB
Convert grayscale image to RGB by replicating the single channel to three. No color information added; use when a model expects 3-channel input.
ToSepia
Apply sepia (brownish vintage) filter via fixed color matrix. Optional alpha for blending with original. Good for style or temporal variation in datasets.
UnsharpMask
Sharpen via unsharp masking: blur, subtract, add back. blur_limit, sigma_limit, alpha control strength. Luminance unchanged; edges enhanced.
Vignetting
Darken corners with a radial (elliptical) gradient. Simulates lens vignetting or natural light falloff. Use for lens realism or stylistic darkening.
ZoomBlur
Radial blur from zoom-during-exposure: average the image with copies zoomed from the center at random factors. Creates motion-like streaks away from the center.
Dual Transforms
(53)Transforms that modify images along with masks, bounding boxes, and keypoints. Essential for detection and segmentation pipelines.
Affine
Apply affine transformations: translation, rotation, scale, shear. Params: scale, translate, rotate, shear, interpolation, fill.
AtLeastOneBBoxRandomCrop
Random crop of fixed size that contains at least one bbox. erosion_factor controls overlap with reference box. Use when some object loss is acceptable.
BBoxSafeRandomCrop
Random crop that keeps all bboxes inside (erosion_rate). Use when losing any object is unacceptable. For at least one bbox use AtLeastOneBBoxRandomCrop.
CenterCrop
Crop the center region of fixed height and width. Optional pad when crop exceeds image. All targets share the same center window. Good for center-focused data.
CoarseDropout
Randomly drop rectangular regions from image (and optionally mask). num_holes_range, hole_size_range, fill. For robustness and regularization.
ConstrainedCoarseDropout
Apply coarse dropout only in regions containing specified objects (mask or bbox labels). mask_indices or bbox_labels; num_holes_range, hole size ranges.
Crop
Crop a fixed region by (x_min, y_min, x_max, y_max). Deterministic; optional pad when region exceeds image. Use for fixed ROI or sliding-window pipelines.
CropAndPad
Crop or pad each side by pixels (px) or fractions (percent). Positive pad, negative crop. Per-side control via tuples. Good for letterboxing or trimming.
CropNonEmptyMaskIfExists
Crop a region containing non-empty mask pixels; if mask empty or missing, fall back to random crop. Good for segmentation to focus on labeled regions.
D4
Apply one of eight D4 square symmetries (rotations and reflections). Keeps square shape. Use group_element for deterministic TTA (e.g. run all 8 then inverse).
ElasticTransform
Apply elastic deformation to images, masks, bboxes, keypoints. Params: alpha, sigma, interpolation. Uses Gaussian-smoothed random displacement fields.
Erasing
Randomly erase rectangular regions (Random Erasing). area_ratio_range, aspect_ratio_range, fill. Improves robustness; common in image classification.
FrequencyMasking
Mask spectrogram in frequency domain. freq_mask_param sets max mask length; SpecAugment-style. Single vertical mask; use XYMasking for more flexibility.
GridDistortion
Apply grid distortion by dividing the image into cells and warping each. Params: num_steps, distort_limit, interpolation, normalized.
GridDropout
Drop rectangular regions in a grid. ratio, unit_size_range or holes_number_xy, random_offset, shift_xy, fill. Applies to images, masks, bboxes, keypoints.
GridElasticDeform
Elastic deformations via a grid: displace control points and interpolate. num_grid_xy and magnitude control density and strength. Good for local stretching.
GridMask
Drop grid-line regions (horizontal and vertical stripes). num_grid_range, line_width_range, rotation_range, fill. Unlike GridDropout which drops cells.
HorizontalFlip
Flip the image left-right (mirror). Same size and layout; self-inverse. Use inverse() for TTA to restore predictions to original orientation.
LetterBox
Scale image to fit a target canvas preserving aspect ratio, then pad to exact canvas size: YOLO letterbox, equivalent to LongestMaxSize + PadIfNeeded.
LongestMaxSize
Rescale an image so that the longest side is equal to max_size or sides meet max_size_hw constraints, keeping the aspect ratio.
MaskDropout
Dropout random objects in a mask; zero those regions in image and mask. max_objects, fill, fill_mask; filters bboxes/keypoints by visibility.
Morphological
Dilation or erosion with a structuring element (scale). For document scans: dilation fills gaps in text; erosion removes noise. Operation and scale per call.
Mosaic
Combine multiple images and annotations into one image via a mosaic grid. Uses metadata for additional images; common in object detection training.
NoOp
Identity transform (does nothing). Passes all targets through unchanged. Use as placeholder or in conditional pipelines.
OpticalDistortion
Apply optical distortion (lens/camera or fisheye model) to images, masks, bboxes, keypoints. Params: distort_limit, mode (camera/fisheye), interpolation.
OverlayElements
Apply overlay images/masks onto an input image (e.g. stickers, logos). Optional bboxes and masks for placement. Uses metadata_key.
Pad
Pad image sides by a number of pixels (all sides, x/y, or per-side). Params: padding, fill, fill_mask, border_mode. Supports image, mask, bboxes, keypoints.
PadIfNeeded
Pad image to meet min height/width and/or divisibility (pad_height_divisor, pad_width_divisor). Position, fill configurable.
Perspective
Apply random four-point perspective transformation. Params: scale, keep_size, border_mode, fill, interpolation. Supports image, mask, bboxes, keypoints.
PiecewiseAffine
Apply piecewise affine transformations via a regular grid of control points. Params: scale, nb_rows, nb_cols, interpolation.
PixelDropout
Drop random pixels. dropout_prob, per_channel, drop_value; applies to image and mask. Fill: constant, random, or inpainting.
RandomCrop
Crop a random region of fixed height and width. Optional pad when crop exceeds image. All targets cropped together. Common for fixed-resolution training.
RandomCropFromBorders
Randomly remove a strip from each border (crop_left/right/top/bottom). No resize; output smaller. Good for trimming variable borders or slight zoom.
RandomCropNearBBox
Crop around a reference bbox (cropping_bbox_key) with random shift (max_part_shift). Use when you have a region of interest to augment.
RandomGridShuffle
Split image into a grid and randomly permute cells; same shuffle for all targets. Grid size from grid (e.g. (3, 3)). Breaks global layout, keeps local content.
RandomResizedCrop
Random crop with scale and ratio ranges (torchvision-style), then resize to size. Standard for training on varying resolutions; scale and ratio control crop.
RandomRotate90
Randomly rotate by 90° (0, 90, 180, or 270). Supports image, mask, bboxes, keypoints, volume. Set group_element for TTA; use inverse() to restore predictions.
RandomScale
Resize by a random scale factor (scale_limit). Output size differs from input; all targets scaled together. Useful for scale augmentation without cropping.
RandomSizedBBoxSafeCrop
Random crop keeping every bbox inside, then resize to (height, width). erosion_rate sets minimum crop size. Use when no object can be cut off.
RandomSizedCrop
Random crop with height in min_max_height and aspect ratio (w2h_ratio), then resize to size. Scale and aspect variation with fixed output size.
Resize
Resize to given height and width. Params: height, width, interpolation, area_for_downscale. Supports image, mask, bboxes, keypoints.
Rotate
Rotate by a random angle from limit (degrees). Optional crop_border removes black corners. Same rotation for image, mask, bboxes, keypoints.
SafeRotate
Rotate by a random angle (limit) but scale to fit in the original frame. No black corners; output size equals input. Good when fixed dimensions are required.
ShiftScaleRotate
One-step affine: random shift, scale, and rotation. Limits sampled per call; good for pose or scale augmentation without separate transforms.
SmallestMaxSize
Rescale an image so that minimum side is equal to max_size or sides meet max_size_hw constraints, keeping the aspect ratio.
SquareSymmetry
Alias for D4: one of eight square symmetries (rotations and reflections). Use group_element for deterministic TTA (e.g. run all 8 then inverse).
ThinPlateSpline
Apply Thin Plate Spline (TPS) for smooth, non-rigid deformations. Control points warp the image like pins on a thin plate; smooth interpolation between points.
TimeMasking
Mask spectrogram in time domain. time_mask_param sets max mask length; SpecAugment-style. Single horizontal mask; use XYMasking for more flexibility.
TimeReverse
Reverse time axis of a spectrogram (time inversion). Alias for HorizontalFlip; for audio. Used in AudioCLIP; p controls probability.
Transpose
Transpose by swapping rows and columns (width/height swap). Supports image, mask, bboxes, keypoints, volume. Self-inverse; use inverse() for TTA.
VerticalFlip
Flip the image upside down. Same size and layout; self-inverse. Use inverse() for TTA to restore predictions to original orientation.
WaterRefraction
Simulate looking through water or wavy glass via sine-wave displacement maps. Params: amplitude_range, wavelength_range, num_waves_range, interpolation.
XYMasking
Apply horizontal or vertical masking strips to simulate occlusion. Useful for spectrograms (spectral/frequency masking).
3D Transforms
(7)Transforms for volumetric data, commonly used in medical imaging.
CenterCrop3D
Take the center sub-volume to fixed (depth, height, width). pad_if_needed fills when smaller; fill, fill_mask. For fixed-size 3D inputs (e.g. CT, MRI).
CoarseDropout3D
Randomly drop cuboid regions from a 3D volume (and optionally mask) to simulate occlusion. Hole size/count configurable.
CubicSymmetry
Apply random cubic symmetry (one of 48) to a 3D volume. No interpolation; remaps voxels. 3D extension of D4. For TTA or augmentation; inverse() supported.
GridShuffle3D
Randomly shuffles the grid's cells on a 3D volume, mask3d, or keypoints, effectively rearranging patches within the volume.
Pad3D
Add voxels around a 3D volume. Padding: int or per-side (depth, height, width); fill, fill_mask. For fixed-size batches or avoiding crop boundaries.
PadIfNeeded3D
Pad 3D volume to min dimensions (min_zyx) and/or divisibility (pad_divisor_zyx). position, fill, fill_mask. At least one of min_zyx or pad_divisor_zyx required.
RandomCrop3D
Extract a random 3D sub-volume of given (depth, height, width). pad_if_needed when smaller; fill, fill_mask. For spatial augmentation of volumetric data.