
Pixijs Filters
- 3k installs
- 293 repo stars
- Updated June 4, 2026
- pixijs/pixijs-skills
pixijs-filters is a PixiJS v8 skill for built-in filters, custom GLSL shaders, chaining, and pixi-filters community packages.
About
PixiJS Filters attaches visual effects by assigning one filter or a chained array to container.filters, covering built-in AlphaFilter, BlurFilter, ColorMatrixFilter, DisplacementFilter, and NoiseFilter plus custom Filter.from GLSL or WGSL fragment shaders. PixiJS v8 requires options-object Filter constructors with GlProgram or GpuProgram wrappers instead of legacy positional vertex, fragment, and uniforms forms. Custom shaders use out vec4 finalColor, texture() sampling, and grouped resources with typed uniform values. Filter options include resolution, padding, antialias, blendRequired for back-buffer sampling, clipToViewport, and filterArea rectangles to skip per-frame bounds measurement on large containers. Community filters import from pixi-filters adjustment and glow paths, not deprecated @pixi/filter packages from v7. Advanced blend modes require importing pixi.js/advanced-blend-modes and enabling useBackBuffer on WebGL init. Common mistakes include chaining too many filters without containerizing and sharing filter instances without understanding framebuffer switch costs. The skill links to pixijs-custom-rendering for shader internals, pixijs-blend-modes for composition, an.
- Built-in blur, color matrix, displacement, alpha, and noise filters.
- v8 Filter.from and GlProgram options-object constructors.
- filterArea optimization for known bounds containers.
- pixi-filters v8 import paths replace @pixi/filter packages.
- Advanced blend modes need useBackBuffer and extension import.
Pixijs Filters by the numbers
- 2,997 all-time installs (skills.sh)
- +217 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #170 of 2,277 Frontend Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
pixijs-filters capabilities & compatibility
- Capabilities
- built in alpha blur colormatrix displacement noi · custom filter.from glsl and wgsl fragment shader · filter chaining on containers and sprites · filterarea bounds and resolution tuning · pixi filters community package imports · advanced blend mode setup with back buffer
- Use cases
- frontend · ui design
- Pricing
- Free
What pixijs-filters says it does
import { AdjustmentFilter } from "pixi-filters/adjustment"
container.filterArea = new Rectangle(0, 0, 800, 600)
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-filtersAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3k |
|---|---|
| repo stars | ★ 293 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 4, 2026 |
| Repository | pixijs/pixijs-skills ↗ |
How do I apply and chain PixiJS v8 filters without deprecated constructor patterns?
Apply PixiJS v8 built-in and custom GLSL filters with chaining, filterArea optimization, and pixi-filters community packages.
Who is it for?
Canvas and game frontend developers adding blur, color grading, or custom shaders in PixiJS v8.
Skip if: Skip for CSS-only effects, non-Pixi WebGL apps, or backend image batch jobs.
When should I use this skill?
User asks about PixiJS filters, BlurFilter, Filter.from, GLSL shaders, or pixi-filters packages.
What you get
Configured filter or filter chain with correct v8 options, resources, and optional filterArea bounds.
- Filter pipeline configuration
- Custom shader filter setup
By the numbers
- Covers 5 built-in filter types: Alpha, Blur, ColorMatrix, Displacement, Noise
- MIT license in pixijs/pixijs-skills metadata
Files
Attach visual effects by assigning one filter (or an array for chaining) to container.filters. Built-in filters cover blur, color matrix, displacement, alpha, and noise; custom filters wrap a GLSL/WGSL fragment shader via Filter.from(...).
Quick Start
const sprite = new Sprite(await Assets.load("hero.png"));
app.stage.addChild(sprite);
const blur = new BlurFilter({ strength: 4, quality: 4 });
const colorMatrix = new ColorMatrixFilter();
colorMatrix.brightness(1.2, false);
sprite.filters = [blur, colorMatrix];
const container = new Container();
container.filters = [new BlurFilter({ strength: 2 })];
container.filterArea = new Rectangle(0, 0, 800, 600);
app.stage.addChild(container);Related skills: pixijs-custom-rendering (shader internals, uniform types), pixijs-blend-modes (composing with filters), pixijs-performance (filter tuning, filterArea).
Core Patterns
Built-in filters
import {
AlphaFilter,
BlurFilter,
ColorMatrixFilter,
DisplacementFilter,
NoiseFilter,
Assets,
Sprite,
} from "pixi.js";
// Alpha (uniform transparency without per-child layering)
const alpha = new AlphaFilter({ alpha: 0.5 });
// Blur — strength/quality are uniform; strengthX/strengthY split axes;
// kernelSize must be odd (5, 7, 9, ... 15); repeatEdgePixels avoids transparent edges
const blur = new BlurFilter({
strength: 4,
quality: 4,
kernelSize: 5,
repeatEdgePixels: false,
});
// Color matrix — brightness is one of many presets. Others: tint, hue,
// contrast, saturate, desaturate, greyscale/grayscale, blackAndWhite,
// negative, sepia, technicolor, polaroid, kodachrome, browni, vintage,
// colorTone, night, predator, lsd, reset. Direct access via
// `colorMatrix.matrix` (20-element array) and `colorMatrix.alpha` (blend
// between original and transformed).
const colorMatrix = new ColorMatrixFilter();
colorMatrix.brightness(1.5, false);
colorMatrix.contrast(0.5, true); // multiply stacks on top of existing matrix
colorMatrix.alpha = 0.7; // blend at 70% strength
// Displacement — scale is a number or PointData
const displacementTexture = await Assets.load("displacement_map.png");
const displacementSprite = new Sprite(displacementTexture);
const displacement = new DisplacementFilter({
sprite: displacementSprite,
scale: { x: 20, y: 10 },
});
// Noise — seed is an arbitrary number that determines the noise pattern; same seed reproduces the same pattern
const noise = new NoiseFilter({ noise: 0.5, seed: Math.random() });
sprite.filters = [blur, colorMatrix];Custom filter with Filter.from()
The simplest way to create a custom filter. Only a fragment shader is needed; PixiJS provides a default vertex shader.
import { Filter } from "pixi.js";
const filter = Filter.from({
gl: {
fragment: `
in vec2 vTextureCoord;
out vec4 finalColor;
uniform sampler2D uTexture;
uniform float uTime;
void main() {
vec2 uv = vTextureCoord;
uv.x += sin(uv.y * 10.0 + uTime) * 0.02;
finalColor = texture(uTexture, uv);
}
`,
},
resources: {
timeUniforms: {
uTime: { value: 0, type: "f32" },
},
},
});
sprite.filters = filter;
app.ticker.add((ticker) => {
filter.resources.timeUniforms.uniforms.uTime += 0.04 * ticker.deltaTime;
});For more control, construct GlProgram/GpuProgram objects directly:
import { Filter, GlProgram } from "pixi.js";
const glProgram = GlProgram.from({ fragment: fragmentSrc, vertex: vertexSrc });
const filter = new Filter({
glProgram,
resources: {
timeUniforms: {
uTime: { value: 0, type: "f32" },
},
},
});Key points:
- Use
out vec4 finalColorin fragment shaders, notgl_FragColor(GLSL ES 3.0). - Use
texture()to sample, nottexture2D. glProgramfor WebGL,gpuProgramfor WebGPU. Omitting one skips that renderer.- Textures go in
resources, not uniforms. The filter system auto-providesuTexture(the input). - Access uniform values via
filter.resources.{groupName}.uniforms.{name}.
Filter options
import { Filter, GlProgram, Rectangle } from "pixi.js";
const filter = new Filter({
glProgram: GlProgram.from({ fragment }),
resources: {},
resolution: 0.5, // default 1. Lower = faster, blurrier. 'inherit' matches the render target resolution
padding: 10, // default 0. Extra pixels for effects that extend bounds
antialias: "off", // default 'off'. 'on' | 'off' | 'inherit'
blendMode: "normal", // default 'normal'
blendRequired: false, // default false. true if shader samples uBackTexture
clipToViewport: true, // default true
});
// Optimization: set known bounds to avoid per-frame measurement
container.filterArea = new Rectangle(0, 0, 800, 600);
// Toggle without rebuilding the filter array
filter.enabled = false;
// Share one filter instance across many display objects
sprite1.filters = [filter];
sprite2.filters = [filter];Community filters (pixi-filters)
import { AdjustmentFilter } from "pixi-filters/adjustment";
import { GlowFilter } from "pixi-filters/glow";
sprite.filters = [
new AdjustmentFilter({ brightness: 1.2, contrast: 1.1 }),
new GlowFilter({ distance: 15, outerStrength: 2 }),
];For v8, community filters use pixi-filters/{name} imports, not the old @pixi/filter-* packages.
Advanced blend modes
Advanced blend modes (color-burn, overlay, hard-light, etc.) are powered by the filter system and must be imported before use. They also require useBackBuffer: true on WebGL; see the pixijs-blend-modes skill for the full list.
import "pixi.js/advanced-blend-modes";
await app.init({ useBackBuffer: true });
sprite.blendMode = "color-burn";Advanced blend modes are filter-based, so they inherit Filter.defaultOptions, whose resolution defaults to 1. On high-DPI render targets this can make a blend mode look clipped, scaled, or only partially applied. Set Filter.defaultOptions.resolution = 'inherit' before creating the affected objects to render at the render target resolution, at higher memory and runtime cost:
import { Filter } from "pixi.js";
import "pixi.js/advanced-blend-modes";
Filter.defaultOptions.resolution = "inherit";
sprite.blendMode = "overlay";Common Mistakes
[CRITICAL] Using old Filter constructor (vertex, fragment, uniforms)
Wrong:
import { Filter } from "pixi.js";
const filter = new Filter(vertex, fragment, { uTime: 0 });Correct:
import { Filter, GlProgram } from "pixi.js";
const filter = new Filter({
glProgram: GlProgram.from({ fragment, vertex }),
resources: {
timeUniforms: { uTime: { value: 0, type: "f32" } },
},
});v8 uses an options object. Shaders must be wrapped in GlProgram.from() or GpuProgram.from(). Uniforms are grouped in resources with explicit types. Textures are resources, not uniforms.
[HIGH] Using @pixi/filter-\* packages for v8
Wrong:
import { AdjustmentFilter } from "@pixi/filter-adjustment";Correct:
import { AdjustmentFilter } from "pixi-filters/adjustment";@pixi/filter-* packages are v7 only. For v8, the community filters package restructured to pixi-filters/{name}.
[HIGH] Using too many filters without containerizing
Each filter application requires a framebuffer switch, bounds measurement, and render-to-texture pass. One filter on a parent container is much cheaper than the same filter on each child.
Wrong:
for (const child of container.children) {
child.filters = [new BlurFilter({ strength: 4 })];
}Correct:
container.filters = [new BlurFilter({ strength: 4 })];[HIGH] Using a blendRequired filter without useBackBuffer on WebGL
Custom filters and most advanced community filters that set blendRequired: true sample the back buffer. On WebGL that only works if the renderer was initialized with useBackBuffer: true; otherwise PixiJS logs a warning and the filter silently falls back:
await app.init({ useBackBuffer: true });WebGPU enables the back buffer unconditionally, so this only affects WebGL.
[MEDIUM] Not setting filterArea for known-size containers
Without filterArea, PixiJS measures the container bounds every frame via getGlobalBounds(), which recursively walks all children. For containers with known dimensions, set filterArea to avoid this cost:
import { Rectangle } from "pixi.js";
container.filterArea = new Rectangle(0, 0, 800, 600);
container.filters = [someFilter];API Reference
Related skills
FAQ
How create custom filters in v8?
Use Filter.from or Filter with GlProgram.from and grouped resources with typed uniforms.
Which community filter import path?
Use pixi-filters/adjustment style imports, not @pixi/filter packages.
When set filterArea?
When bounds are known to avoid per-frame measurement overhead on large containers.
Is Pixijs Filters safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.