function scaleImage
scaleImage(
srcPath: string,
outPath: string,
width: ImageWidth,
unnamed 3: ImageTraits,
format?: ScaledFormat
): Promise<void>

Writes a copy of an image at most width wide, never wider than the image itself, as a WebP unless format names another. WebP keeps a PNG's transparency and a GIF's animation, at a fraction of either's bytes.

Parameters

srcPath: string
outPath: string
unnamed 3: ImageTraits
optional
format: ScaledFormat = webp

Return Type

Promise<void>

Usage

import { scaleImage } from "api/lib/ffmpeg.ts";