Skip to main content
Module

x/monke/mod.ts>Image

Color quantization and dithering in TypeScript.
Go to Latest
class Image
import { Image } from "https://deno.land/x/monke@v0.0.4/mod.ts";

Image with width, height, and pixel data

Constructors

new
Image(
pixels: Uint8ClampedArray,
width: number,
height?: number,
)

Properties

height: number
pixels: Color[]
width: number

Methods

blur(method: BlurType)

Blur the image. Currently only supports box blur.

dither(palette: Color[], options?: DitherOptions)

Recolor the image with dithering

grayscale(): void

Make the image grayscale

invert(): void

Invert colors in the image

monochrome(): void

Recolor the image using just black and white

recolor(palette: Color[])

Recolor the image without dithering

toImageData(): { data: Uint8ClampedArray; width: number; height: number; }

Convert to an ImageData object