Canvacord

ImageGen

extendsEncodable

Creates a new ImageGen instance.

new ImageGen(template)
ParameterTypeDescriptionOptional
template

The template to use

Properties

template

The template to use

Methods

addStep(step);

Adds a step to the template.

ParameterTypeDescriptionOptional
step

The step to add

Returns:ImageGen

addSteps(steps);

Adds steps to the template.

ParameterTypeDescriptionOptional
steps

The steps to add

Returns:ImageGen

encode();

Encodes the canvas to a buffer.

Returns:Promise<Buffer>

generateGif();

Generates a readable stream containing GIF data by applying the steps.

Returns:Promise<Readable>

getFinalCanvas();

Returns the canvas instance by applying the steps.

Returns:Promise<Canvas>

isGif();

Returns whether the template is a gif.

Returns:boolean

render();

Renders the image by applying the steps.

Returns:Promise<ImageGen>

setGifOptions([options]);

Sets the gif options.

ParameterTypeDescriptionOptional
options
EncoderOptions

The gif options

Returns:ImageGen