skillfed

blend-modes

Image processing blend modes

blend-modes v2.2.0 153.5K downloads/30d#10,880 on PyPI158
Permissive license MIT Active released

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-modes

uv

uv add blend-modes

poetry

poetry add blend-modes

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.5Topic :: Multimedia :: Graphics :: Graphics Conversion

Tags

image blend modeslayer blendingimage compositingsoft light dodge multiplyphotoshop blend modes pythonimage layer mixingnumpy image blending
image-processinggraphics-compositing

More Graphics Conversion packages