Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/canvas/mod.ts>ImageFilterFactory

Canvas API for Deno, ported from canvaskit-wasm (Skia).
Latest
interface ImageFilterFactory
import { type ImageFilterFactory } from "https://deno.land/x/canvas@v1.4.2/mod.ts";

See effects/ImageFilters.h for more.

Methods

MakeBlur(
sigmaX: number,
sigmaY: number,
mode: TileMode,
input: ImageFilter | null,
): ImageFilter

Create a filter that blurs its input by the separate X and Y sigmas. The provided tile mode is used when the blur kernel goes outside the input image.

MakeColorFilter(cf: ColorFilter, input: ImageFilter | null): ImageFilter

Create a filter that applies the color filter to the input filter results.

MakeCompose(outer: ImageFilter | null, inner: ImageFilter | null): ImageFilter

Create a filter that composes 'inner' with 'outer', such that the results of 'inner' are treated as the source bitmap passed to 'outer'. If either param is null, the other param will be returned.

MakeMatrixTransform(
input: ImageFilter | null,
): ImageFilter

Create a filter that transforms the input image by 'matrix'. This matrix transforms the local space, which means it effectively happens prior to any transformation coming from the Canvas initiating the filtering.