AlbumentationsX

June 23, 2026 ยท View on GitHub

PyPI version CI PyPI Downloads

๐Ÿ“ฃ Stay updated! Subscribe to our newsletter for the latest releases, tutorials, and tips.

License: AGPL v3 Commercial License

Docs Discord Twitter LinkedIn Reddit

AlbumentationsX is a Python library for image augmentation. It provides high-performance, robust implementations and cutting-edge features for computer vision tasks. Image augmentation is used in deep learning and computer vision to increase the quality of trained models. The purpose of image augmentation is to create new training samples from the existing data.

GitAds Sponsored

Sponsored by GitAds

๐Ÿ“ข Important: AlbumentationsX Licensing

AlbumentationsX offers dual licensing:

  • AGPL-3.0 License: Free for open-source projects
  • Commercial License: For proprietary/commercial use (contact for pricing)

Quick Start

# Install AlbumentationsX with OpenCV
pip install albumentationsx[headless]

# Or if you already have OpenCV installed
pip install albumentationsx
import albumentations as A

# Create your augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

For commercial licensing inquiries, please visit our pricing page.


Here is an example of how you can apply some pixel-level augmentations to create new images from the original one: parrot

Why AlbumentationsX

Table of contents

Authors

Current Maintainer

Vladimir I. Iglovikov | Kaggle Grandmaster

Emeritus Core Team Members

Mikhail Druzhinin | Kaggle Expert

Alex Parinov | Kaggle Master

Alexander Buslaev | Kaggle Master

Eugene Khvedchenya | Kaggle Grandmaster

Installation

AlbumentationsX requires Python 3.10 or higher. To install the latest version from PyPI:

Basic Installation

If you already have OpenCV installed (any variant), simply install AlbumentationsX:

pip install -U albumentationsx

Installation with OpenCV

If you don't have OpenCV installed yet, choose the appropriate variant:

# For servers/Docker (no GUI support, lighter package)
pip install -U albumentationsx[headless]

# For local development with GUI support (cv2.imshow, etc.)
pip install opencv-python && pip install -U albumentationsx

# For OpenCV with extra algorithms (contrib modules)
pip install opencv-contrib-python && pip install -U albumentationsx

# For contrib + headless
pip install -U albumentationsx[contrib-headless]

Note: AlbumentationsX works with any OpenCV variant:

  • opencv-python (full version with GUI)
  • opencv-python-headless (no GUI, smaller size)
  • opencv-contrib-python (with extra modules)
  • opencv-contrib-python-headless (contrib + headless)

Choose the one that fits your needs. The library will detect whichever is installed.

Other installation options are described in the documentation.

Documentation

The full documentation is available at https://albumentations.ai/docs/.

For AI-assisted augmentation review, AlbumentationsX can also be used through MCP-capable hosts such as Claude Desktop, Cursor, Claude Code, and Codex. The community AlbumentationsX MCP integration lets assistants inspect transforms, validate pipelines, render bounded local preview batches, compare preview runs, collect concrete feedback, and export reproducible AlbumentationsX pipelines.

A simple example

import albumentations as A
import cv2

# Declare an augmentation pipeline
transform = A.Compose([
    A.RandomCrop(width=256, height=256),
    A.HorizontalFlip(p=0.5),
    A.RandomBrightnessContrast(p=0.2),
])

# Read an image with OpenCV and convert it to the RGB colorspace
image = cv2.imread("image.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)

# Augment an image
transformed = transform(image=image)
transformed_image = transformed["image"]

AlbumentationsX collects anonymous usage statistics to improve the library. This can be disabled with ALBUMENTATIONS_OFFLINE=1 or ALBUMENTATIONS_NO_TELEMETRY=1.

List of augmentations

Pixel-level transforms

Pixel-level transforms will change just an input image and will leave any additional targets such as masks, bounding boxes, and keypoints unchanged. For volumetric data (volumes and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The list of pixel-level transforms:

Spatial-level transforms

Spatial-level transforms will simultaneously change both an input image as well as additional targets such as masks, bounding boxes, and keypoints. For volumetric data (volumes and 3D masks), these transforms are applied independently to each slice along the Z-axis (depth dimension), maintaining consistency across the volume. The following table shows which additional targets are supported by each transform:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformImageMaskBBoxes (HBB)BBoxes (OBB)KeypointsVolumeMask3D
Affineโœ“โœ“โœ“โœ“โœ“โœ“โœ“
AtLeastOneBBoxRandomCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
BBoxSafeRandomCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
CenterCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
CoarseDropoutโœ“โœ“โœ“โœ“โœ“โœ“
ConstrainedCoarseDropoutโœ“โœ“โœ“โœ“โœ“โœ“
CopyAndPasteโœ“โœ“โœ“โœ“
Cropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
CropAndPadโœ“โœ“โœ“โœ“โœ“โœ“โœ“
CropNonEmptyMaskIfExistsโœ“โœ“โœ“โœ“โœ“โœ“โœ“
D4โœ“โœ“โœ“โœ“โœ“โœ“โœ“
ElasticTransformโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Erasingโœ“โœ“โœ“โœ“โœ“โœ“
FrequencyMaskingโœ“โœ“โœ“โœ“โœ“โœ“
GridDistortionโœ“โœ“โœ“โœ“โœ“โœ“โœ“
GridDropoutโœ“โœ“โœ“โœ“โœ“โœ“
GridElasticDeformโœ“โœ“โœ“โœ“โœ“โœ“
GridMaskโœ“โœ“โœ“โœ“โœ“โœ“
HorizontalFlipโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Lambdaโœ“โœ“โœ“โœ“โœ“โœ“โœ“
LetterBoxโœ“โœ“โœ“โœ“โœ“โœ“โœ“
LongestMaxSizeโœ“โœ“โœ“โœ“โœ“โœ“โœ“
MaskDropoutโœ“โœ“โœ“โœ“โœ“โœ“
Morphologicalโœ“โœ“โœ“โœ“โœ“โœ“
Mosaicโœ“โœ“โœ“โœ“โœ“
NoOpโœ“โœ“โœ“โœ“โœ“โœ“โœ“
OpticalDistortionโœ“โœ“โœ“โœ“โœ“โœ“โœ“
OverlayElementsโœ“โœ“
Padโœ“โœ“โœ“โœ“โœ“โœ“โœ“
PadIfNeededโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Perspectiveโœ“โœ“โœ“โœ“โœ“โœ“โœ“
PiecewiseAffineโœ“โœ“โœ“โœ“โœ“โœ“โœ“
PixelDropoutโœ“โœ“โœ“โœ“โœ“โœ“โœ“
PixelSpreadโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomCropFromBordersโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomCropNearBBoxโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomGridShuffleโœ“โœ“โœ“โœ“โœ“โœ“
RandomResizedCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomRotate90โœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomScaleโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomSizedBBoxSafeCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
RandomSizedCropโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Resizeโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Rotateโœ“โœ“โœ“โœ“โœ“โœ“โœ“
SafeRotateโœ“โœ“โœ“โœ“โœ“โœ“โœ“
ShiftScaleRotateโœ“โœ“โœ“โœ“โœ“โœ“โœ“
SmallestMaxSizeโœ“โœ“โœ“โœ“โœ“โœ“โœ“
SquareSymmetryโœ“โœ“โœ“โœ“โœ“โœ“โœ“
ThinPlateSplineโœ“โœ“โœ“โœ“โœ“โœ“โœ“
TimeMaskingโœ“โœ“โœ“โœ“โœ“โœ“
TimeReverseโœ“โœ“โœ“โœ“โœ“โœ“โœ“
Transposeโœ“โœ“โœ“โœ“โœ“โœ“โœ“
VerticalFlipโœ“โœ“โœ“โœ“โœ“โœ“โœ“
WaterRefractionโœ“โœ“โœ“โœ“โœ“โœ“โœ“
XYMaskingโœ“โœ“โœ“โœ“โœ“โœ“

3D transforms

3D transforms operate on volumetric data and can modify both the input volume and associated 3D mask.

Where:

  • Volume: 3D array of shape (D, H, W) or (D, H, W, C) where D is depth, H is height, W is width, and C is number of channels (optional)
  • Mask3D: Binary or multi-class 3D mask of shape (D, H, W) where each slice represents segmentation for the corresponding volume slice
TransformVolumeMask3DKeypoints
CenterCrop3Dโœ“โœ“โœ“
CoarseDropout3Dโœ“โœ“โœ“
CubicSymmetryโœ“โœ“โœ“
GridShuffle3Dโœ“โœ“โœ“
Pad3Dโœ“โœ“โœ“
PadIfNeeded3Dโœ“โœ“โœ“
RandomCrop3Dโœ“โœ“โœ“

A few more examples of augmentations

Semantic segmentation on the Inria dataset

inria

Medical imaging

medical

Object detection and semantic segmentation on the Mapillary Vistas dataset

vistas

Keypoints augmentation

Benchmark Results

Image Benchmark Results

System Information

  • Platform: macOS-15.1-arm64-arm-64bit
  • Processor: arm
  • CPU Count: 16
  • Python Version: 3.12.8

Benchmark Parameters

  • Number of images: 2000
  • Runs per transform: 5
  • Max warmup iterations: 1000

Library Versions

  • albumentationsx: 2.0.8
  • augly: 1.0.0
  • imgaug: 0.4.0
  • kornia: 0.8.0
  • torchvision: 0.20.1

Performance Comparison

Number shows how many uint8 images per second can be processed on one CPU thread. Larger is better. The Speedup column shows how many times faster AlbumentationsX is compared to the fastest other library for each transform.

Transformalbumentationsx
2.0.8
augly
1.0.0
imgaug
0.4.0
kornia
0.8.0
torchvision
0.20.1
Speedup
(AlbX/fastest other)
Affine1445 ยฑ 9-1328 ยฑ 16248 ยฑ 6188 ยฑ 21.09x
AutoContrast1657 ยฑ 13--541 ยฑ 8344 ยฑ 13.06x
Blur7657 ยฑ 114386 ยฑ 45381 ยฑ 125265 ยฑ 11-1.42x
Brightness11985 ยฑ 4552108 ยฑ 321076 ยฑ 321127 ยฑ 27854 ยฑ 135.68x
CLAHE647 ยฑ 4-555 ยฑ 14165 ยฑ 3-1.17x
CenterCrop128119293 ยฑ 2164----N/A
ChannelDropout11534 ยฑ 306--2283 ยฑ 24-5.05x
ChannelShuffle6772 ยฑ 109-1252 ยฑ 261328 ยฑ 444417 ยฑ 2341.53x
CoarseDropout18962 ยฑ 1346-1190 ยฑ 22--15.93x
ColorJitter1020 ยฑ 91418 ยฑ 5-104 ยฑ 487 ยฑ 12.44x
Contrast12394 ยฑ 3631379 ยฑ 25717 ยฑ 51109 ยฑ 41602 ยฑ 138.99x
CornerIllumination484 ยฑ 7--452 ยฑ 3-1.07x
Elastic374 ยฑ 2-395 ยฑ 141 ยฑ 03 ยฑ 00.95x
Equalize1236 ยฑ 21-814 ยฑ 11306 ยฑ 1795 ยฑ 31.52x
Erasing27451 ยฑ 2794--1210 ยฑ 273577 ยฑ 497.67x
GaussianBlur2350 ยฑ 118387 ยฑ 41460 ยฑ 23254 ยฑ 5127 ยฑ 41.61x
GaussianIllumination720 ยฑ 7--436 ยฑ 13-1.65x
GaussianNoise315 ยฑ 4-263 ยฑ 9125 ยฑ 1-1.20x
Grayscale32284 ยฑ 11306088 ยฑ 1073100 ยฑ 241201 ยฑ 522600 ยฑ 235.30x
HSV1197 ยฑ 23----N/A
HorizontalFlip14460 ยฑ 3688808 ยฑ 10129599 ยฑ 4951297 ยฑ 132486 ยฑ 1071.51x
Hue1944 ยฑ 64--150 ยฑ 1-12.98x
Invert27665 ยฑ 3803-3682 ยฑ 792881 ยฑ 434244 ยฑ 306.52x
JpegCompression1321 ยฑ 331202 ยฑ 19687 ยฑ 26120 ยฑ 1889 ยฑ 71.10x
LinearIllumination479 ยฑ 5--708 ยฑ 6-0.68x
MedianBlur1229 ยฑ 9-1152 ยฑ 146 ยฑ 0-1.07x
MotionBlur3521 ยฑ 25-928 ยฑ 37159 ยฑ 1-3.79x
Normalize1819 ยฑ 49--1251 ยฑ 141018 ยฑ 71.45x
OpticalDistortion661 ยฑ 7--174 ยฑ 0-3.80x
Pad48589 ยฑ 2059---4889 ยฑ 1839.94x
Perspective1206 ยฑ 3-908 ยฑ 8154 ยฑ 3147 ยฑ 51.33x
PlankianJitter3221 ยฑ 63--2150 ยฑ 52-1.50x
PlasmaBrightness168 ยฑ 2--85 ยฑ 1-1.98x
PlasmaContrast145 ยฑ 3--84 ยฑ 0-1.71x
PlasmaShadow183 ยฑ 5--216 ยฑ 5-0.85x
Posterize12979 ยฑ 1121-3111 ยฑ 95836 ยฑ 304247 ยฑ 263.06x
RGBShift3391 ยฑ 104--896 ยฑ 9-3.79x
Rain2043 ยฑ 115--1493 ยฑ 9-1.37x
RandomCrop128111859 ยฑ 137445395 ยฑ 93421408 ยฑ 6222946 ยฑ 4231450 ยฑ 2492.46x
RandomGamma12444 ยฑ 753-3504 ยฑ 72230 ยฑ 3-3.55x
RandomResizedCrop4347 ยฑ 37--661 ยฑ 16837 ยฑ 375.19x
Resize3532 ยฑ 671083 ยฑ 212995 ยฑ 70645 ยฑ 13260 ยฑ 91.18x
Rotate2912 ยฑ 681739 ยฑ 1052574 ยฑ 10256 ยฑ 2258 ยฑ 41.13x
SaltAndPepper629 ยฑ 6--480 ยฑ 12-1.31x
Saturation1596 ยฑ 24-495 ยฑ 3155 ยฑ 2-3.22x
Sharpen2346 ยฑ 10-1101 ยฑ 30201 ยฑ 2220 ยฑ 32.13x
Shear1299 ยฑ 11-1244 ยฑ 14261 ยฑ 1-1.04x
Snow611 ยฑ 9--143 ยฑ 1-4.28x
Solarize11756 ยฑ 481-3843 ยฑ 80263 ยฑ 61032 ยฑ 143.06x
ThinPlateSpline82 ยฑ 1--58 ยฑ 0-1.41x
VerticalFlip32386 ยฑ 93616830 ยฑ 165319935 ยฑ 17082872 ยฑ 374696 ยฑ 1611.62x

๐Ÿค Contribute

We thrive on community collaboration! AlbumentationsX wouldn't be the powerful augmentation library it is without contributions from developers like you. Please see our Contributing Guide to get started. A huge Thank You ๐Ÿ™ to everyone who contributes!

AlbumentationsX open-source contributors

We look forward to your contributions to help make the AlbumentationsX ecosystem even better!

๐Ÿ“œ License

AlbumentationsX offers two licensing options to suit different needs:

  • AGPL-3.0 License: This OSI-approved open-source license is perfect for students, researchers, and enthusiasts. It encourages open collaboration and knowledge sharing. See the LICENSE file for full details.
  • AlbumentationsX Commercial License: Designed for commercial use, this license allows for the seamless integration of AlbumentationsX into commercial products and services, bypassing the open-source requirements of AGPL-3.0. If your use case involves commercial deployment, please visit our pricing page.

๐Ÿ“ž Contact

For bug reports and feature requests related to AlbumentationsX, please visit GitHub Issues. For questions, discussions, and community support, join our active communities on Discord, Twitter, LinkedIn, and Reddit. We're here to help with all things AlbumentationsX!

Citing

If you find this library useful for your research, please consider citing Albumentations: Fast and Flexible Image Augmentations:

@Article{info11020125,
    AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
    TITLE = {Albumentations: Fast and Flexible Image Augmentations},
    JOURNAL = {Information},
    VOLUME = {11},
    YEAR = {2020},
    NUMBER = {2},
    ARTICLE-NUMBER = {125},
    URL = {https://www.mdpi.com/2078-2489/11/2/125},
    ISSN = {2078-2489},
    DOI = {10.3390/info11020125}
}

๐Ÿ“ซ Stay Connected

Never miss updates, tutorials, and tips from the AlbumentationsX team! Subscribe to our newsletter.