blend-modes
Image processing blend modes
What it is and what it does
Blend Modes is a NumPy-based image compositing library that applies blend modes—the layer-blending algorithms used in graphics editors—to combine two images. It supports fourteen modes including soft light, dodge, multiply, overlay, and grain extract, each producing different visual effects by controlling how pixel values from a foreground layer mix with a background layer. You pass two same-sized NumPy arrays (in RGBA format with float values 0–255) and an opacity parameter; the function returns a blended array in the same format.
The package is designed for speed through NumPy vectorization and integrates easily with image-loading libraries like Pillow or OpenCV. It's useful when you need programmatic control over layer blending in image processing pipelines—tasks that would otherwise require calling external graphics software or reimplementing blend algorithms yourself.
Use it for:
- Composite multiple image layers in batch image processing pipelines with control over blend mode and opacity.
- Apply Photoshop-style blend modes to images loaded via Pillow or OpenCV without leaving Python.
- Generate image effects (dodge, multiply, overlay) programmatically for graphics generation or photo editing tools.
- Blend watermarks, overlays, or annotations onto background images with precise blending control.
- Implement layer-based image editing in custom graphics applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements blend modes (soft light, dodge, multiply, overlay, and others) for compositing image layers using NumPy arrays, mirroring functionality found in graphics software like Photoshop and GIMP.
Yes. The package is stable, actively maintained, has no known vulnerabilities, installs with minimal friction (NumPy only), and fills a genuine gap for programmatic image blending. Install it if you need to composite images with blend modes in Python; skip it if you only need basic image overlay without blend mode control.
Install
blend-modes on PyPI
pip
pip install blend-modesuv
uv add blend-modespoetry
poetry add blend-modesInstalling blend-modes
Before you install
Low friction: pure Python wheel with only NumPy as a runtime dependency. Actively maintained with recent commits and a stable release history since 2016.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install blend_modes
from blend_modes import soft_light
import numpy as np
# Assuming bg_img and fg_img are numpy float arrays with shape (height, width, 4)
blended = soft_light(bg_img, fg_img, opacity=0.7)
Input images must be NumPy float arrays in RGBA format with shape (height, width, 4) and values in range 0.0–255.0; both images must have identical dimensions.
Verify before relying
- Whether Cython optimization mentioned in the description is available or planned as a separate package.
- Current Python version support (classifiers list 3.5 but requires_python is unspecified).
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 667 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 153,512/month — #10,880 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: blend_modes-2.2.0-py3-none-any.whl
Keywords: image, processing, blend, modes
Tags
More Graphics Conversion packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
weasyprintWeasyPrint converts HTML and CSS into PDF…
permissive · top 1,000 on PyPI
CairoSVGCairoSVG converts SVG files to PDF, EPS, PS,…
copyleft · top 5,000 on PyPI
pillow-heifpillow-heif adds HEIF/HEIC image format support…
copyleft · top 5,000 on PyPI
rasterioRasterio reads and writes geospatial raster…
permissive · top 5,000 on PyPI
blendmodesApplies a range of blending modes to composite…
permissive · top 15,000 on PyPI
pilgramApplies Instagram-style filters and CSS-based…
permissive · top 15,000 on PyPI
loadimgLoads and converts images between multiple…
permissive · top 15,000 on PyPI
psd-toolspsd-tools reads and writes Adobe Photoshop…
permissive · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI
pilkitPILKit provides a collection of image…
permissive · top 15,000 on PyPI
skia-pathopsPython bindings for Google Skia's Path Ops…
permissive · top 15,000 on PyPI
pixeloeConverts standard images into pixel art using…
permissive · top 15,000 on PyPI
OpenEXRRead and write OpenEXR image files with support…
unclear · top 15,000 on PyPI