pixijs-blend-modes
pixijs/pixijs-skills
GPU-accelerated blend modes for PixiJS v8 display objects, from standard (add, multiply, screen) to advanced (color-burn, overlay, hard-light).
What is pixijs-blend-modes?
Apply blend modes to composite display objects in PixiJS v8 using GPU equations (standard modes) or filter-based advanced modes. Use this when you need lighting effects, shadows, overlays, or custom color compositing. Standard modes are hardware-accelerated; advanced modes require an explicit import and useBackBuffer: true.
- Set blendMode on any display object to composite with GPU blend equations
- Access 8 standard modes (normal, add, multiply, screen, erase, min, max, none) without extra setup
- Enable 21 advanced modes (color-burn, overlay, hard-light, soft-light, etc.) via pixi.js/advanced-blend-modes import
- Optimize rendering by grouping objects with the same blend mode to minimize batch breaks
- Handle high-DPI rendering with Filter.defaultOptions.resolution for advanced modes
How to install pixijs-blend-modes
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-blend-modes- PixiJS v8 installed
- For advanced modes: import 'pixi.js/advanced-blend-modes' and initialize app with useBackBuffer: true
How to use pixijs-blend-modes
- 1.Import PixiJS Sprite or Container
- 2.Set the blendMode property to a string ('add', 'multiply', 'screen', etc.)
- 3.For advanced modes, import 'pixi.js/advanced-blend-modes' at the top of your file
- 4.Initialize your Application with useBackBuffer: true if using advanced modes
- 5.Order display objects so siblings with the same blend mode are adjacent to minimize batch breaks
Use cases
- Create additive glow or light effects using 'add' blend mode
- Darken layers with shadows using 'multiply' blend mode
- Apply color-burn or overlay effects for image compositing
- Build UI with screen or dodge effects for highlights
- Optimize performance by ordering blend-mode transitions to reduce draw calls
- PixiJS game developers building visual effects
- Graphics programmers implementing custom compositing
- Web developers creating interactive canvas-based UIs
- Artists and designers working with real-time rendering
pixijs-blend-modes FAQ
Standard modes (normal, add, multiply, screen, erase, min, max) use GPU blend equations directly and are hardware-accelerated. Advanced modes (color-burn, overlay, hard-light, etc.) use the filter pipeline and cost more but offer richer compositing effects. Advanced modes require the pixi.js/advanced-blend-modes import and useBackBuffer: true.
Advanced blend modes require two things: (1) import 'pixi.js/advanced-blend-modes' at the top of your file, and (2) initialize your Application with useBackBuffer: true. Without either, the mode silently falls back to normal.
Blend mode transitions break render batches. Group objects with the same blend mode together in the display tree. For example, render all 'screen' objects, then all 'normal' objects, rather than alternating between them.
Advanced blend modes use filters, which default to resolution 1. On retina displays, set Filter.defaultOptions.resolution = 'inherit' before creating affected objects to render at the target's native resolution.
No. In PixiJS v8, BLEND_MODES is a TypeScript type only. Use string literals instead: sprite.blendMode = 'add' instead of sprite.blendMode = BLEND_MODES.ADD.
Full instructions (SKILL.md)
Source of truth, from pixijs/pixijs-skills.
name: pixijs-blend-modes description: "Use this skill when compositing display objects with blend modes in PixiJS v8. Covers standard modes (normal, add, multiply, screen, erase, min, max), advanced modes via pixi.js/advanced-blend-modes (color-burn, overlay, hard-light, etc.), batch-friendly ordering. Triggers on: blendMode, additive, multiply, screen, overlay, color-burn, color-dodge, advanced-blend-modes, glow, erase." license: MIT
Set container.blendMode to composite display objects with GPU blend equations (standard modes) or filter-based advanced modes. Blend-mode transitions break render batches, so group like-mode siblings together.
Quick Start
const light = new Sprite(await Assets.load("light.png"));
light.blendMode = "add";
app.stage.addChild(light);
const shadow = new Sprite(await Assets.load("shadow.png"));
shadow.blendMode = "multiply";
app.stage.addChild(shadow);
import "pixi.js/advanced-blend-modes";
const overlay = new Sprite(await Assets.load("overlay.png"));
overlay.blendMode = "color-burn";
app.stage.addChild(overlay);
Related skills: pixijs-filters (advanced modes use the filter pipeline), pixijs-performance (batching with blend modes), pixijs-color (color manipulation).
Core Patterns
Standard blend modes
Standard modes are built in and use GPU blend equations directly:
import { Sprite } from "pixi.js";
sprite.blendMode = "normal"; // standard alpha compositing (effective default at root)
sprite.blendMode = "add"; // additive (lighten, glow effects)
sprite.blendMode = "multiply"; // multiply (darken, shadow effects)
sprite.blendMode = "screen"; // screen (lighten, dodge effects)
sprite.blendMode = "erase"; // erase pixels from render target
sprite.blendMode = "none"; // no blending, overwrites destination
sprite.blendMode = "inherit"; // inherit from parent (this is the actual default value)
sprite.blendMode = "min"; // keeps minimum of source and destination (WebGL2+ only)
sprite.blendMode = "max"; // keeps maximum of source and destination (WebGL2+ only)
These are hardware-accelerated and cheap. They do not require filters.
Advanced blend modes
Advanced modes require an explicit import to register the extensions. On the WebGL renderer they also require useBackBuffer: true at init time, or PixiJS logs a warning and the blend silently falls back:
import "pixi.js/advanced-blend-modes";
import { Application, Sprite, Assets } from "pixi.js";
const app = new Application();
await app.init({ useBackBuffer: true }); // required for advanced modes on WebGL
const texture = await Assets.load("overlay.png");
const overlay = new Sprite(texture);
overlay.blendMode = "color-burn";
Available advanced modes:
| Mode | Effect |
|---|---|
color-burn | Darkens by increasing contrast |
color-dodge | Brightens by decreasing contrast |
darken | Keeps darker of two layers |
difference | Absolute difference |
divide | Divides bottom by top |
exclusion | Similar to difference, lower contrast |
hard-light | Multiply or screen based on top layer |
hard-mix | High contrast threshold blend |
lighten | Keeps lighter of two layers |
linear-burn | Adds and subtracts to darken |
linear-dodge | Adds layers together |
linear-light | Linear burn or dodge based on top layer |
luminosity | Luminosity of top, hue/saturation of bottom |
negation | Inverted difference |
overlay | Multiply or screen based on bottom layer |
pin-light | Replaces based on lightness comparison |
saturation | Saturation of top, hue/luminosity of bottom |
soft-light | Gentle overlay effect |
subtract | Subtracts top from bottom |
vivid-light | Color burn or dodge based on top layer |
color | Hue and saturation of top, luminosity of bottom |
You set advanced blend modes the same way as standard ones, via the blendMode property. They use filters internally, so they cost more than standard modes.
Batch-friendly ordering
Different blend modes break the rendering batch. Order objects to minimize transitions:
import { Container, Sprite } from "pixi.js";
const scene = new Container();
scene.addChild(screenSprite1); // 'screen'
scene.addChild(screenSprite2); // 'screen'
scene.addChild(normalSprite1); // 'normal'
scene.addChild(normalSprite2); // 'normal'
2 draw calls. Alternating order (screen, normal, screen, normal) would produce 4.
Common Mistakes
[HIGH] Not importing advanced-blend-modes extension
Wrong:
import { Sprite } from "pixi.js";
sprite.blendMode = "color-burn"; // silently falls back to normal
Correct:
import "pixi.js/advanced-blend-modes";
import { Sprite } from "pixi.js";
sprite.blendMode = "color-burn";
Advanced blend modes (color-burn, overlay, etc.) require the extension import. Without it, only standard modes (normal, add, multiply, screen) are available. The invalid mode silently falls back.
[MEDIUM] Mixing blend modes across adjacent objects
Different blend modes break the render batch. screen / normal / screen / normal produces 4 draw calls, while screen / screen / normal / normal produces 2. Sort children so objects with the same blend mode are adjacent.
[HIGH] Using the v7 BLEND_MODES enum
Wrong:
import { BLEND_MODES } from "pixi.js";
sprite.blendMode = BLEND_MODES.ADD; // runtime error: BLEND_MODES is undefined
Correct:
sprite.blendMode = "add";
In v8, BLEND_MODES is a TypeScript type only (a union of string literals). There is no runtime enum export, so BLEND_MODES.ADD evaluates to accessing a property on undefined. Use the string form.
[HIGH] Advanced blend modes without useBackBuffer
Wrong:
import "pixi.js/advanced-blend-modes";
await app.init({
/* no useBackBuffer */
});
sprite.blendMode = "color-burn"; // logs a warning, falls back
Correct:
import "pixi.js/advanced-blend-modes";
await app.init({ useBackBuffer: true });
sprite.blendMode = "color-burn";
Advanced modes read from the back buffer. On WebGL, the blend silently falls back if the back buffer is not enabled. WebGPU enables the back buffer unconditionally.
[MEDIUM] Advanced blend modes clipped or scaled on high-DPI renderers
Advanced blend modes are filter-based and use Filter.defaultOptions, whose resolution defaults to 1. On a high-DPI render target the blended object can look clipped, scaled, or only partially applied.
Wrong:
import "pixi.js/advanced-blend-modes";
sprite.blendMode = "overlay"; // renders at resolution 1, can clip on retina
Correct:
import { Filter } from "pixi.js";
import "pixi.js/advanced-blend-modes";
Filter.defaultOptions.resolution = "inherit"; // set before creating affected objects
sprite.blendMode = "overlay";
Setting Filter.defaultOptions.resolution = "inherit" makes advanced blend modes render at the render target's resolution. This costs more memory and runtime, so apply it where fidelity matters.
API Reference
Related skills
More from pixijs/pixijs-skills and the wider catalog.

pixijs-color
Create, convert, and manipulate colors in PixiJS v8 with flexible input formats and chainable operations.

pixijs-core-concepts
Understand PixiJS v8 renderer architecture, render loop, and environment adaptation.

pixijs-create
Scaffold a new PixiJS v8 project or add PixiJS to an existing one with create-pixi CLI.

pixijs-custom-rendering
Write custom shaders, uniforms, filters, and batchers in PixiJS v8 with WebGL and WebGPU support.

pixijs-environments
Run PixiJS v8 outside the browser: Web Workers, OffscreenCanvas, Node/SSR, and CSP-restricted contexts.

pixijs-events
Handle pointer, mouse, touch, and wheel input in PixiJS v8 with federated events.