Skip to main content

Class: JimpProcessor

mugshot.JimpProcessor

Process screenshots using Jimp.

Implements#

Constructors#

constructor#

+ new JimpProcessor(): JimpProcessor

Returns: JimpProcessor

Methods#

crop#

crop(img: Buffer, x: number, y: number, w: number, h: number): Promise<Buffer>

Crop a screenshot to the specified dimensions.

Will throw OutOfBoundsError if trying to crop outside of the image.

Parameters:#

NameType
imgBuffer
xnumber
ynumber
wnumber
hnumber

Returns: Promise<Buffer>

Implementation of: PNGProcessor.crop

Defined in: packages/mugshot/src/lib/jimp-processor.ts:8


paint#

paint(img: Buffer, x: number, y: number, w: number, h: number, c: string): Promise<Buffer>

Draw a colored rectangle over the screenshot.

Parameters:#

NameType
imgBuffer
xnumber
ynumber
wnumber
hnumber
cstring

Returns: Promise<Buffer>

Implementation of: PNGProcessor.paint

Defined in: packages/mugshot/src/lib/jimp-processor.ts:18