Skip to content
1 min read · 163 words

@nhtio/adk/batteries/media/engines/jimp

A cross-environment image @nhtio/adk/batteries/media/contracts!MediaEngine backed by Jimp (pure JavaScript — no native bindings, no binaries).

Remarks

The local-by-default raster engine: runs anywhere TypeScript runs. Declares one mutate capability over png/jpeg/bmp/gif/tiff with resize (cover/contain approximations), rotate, flip, quality, and metadata stripping (Jimp re-encodes pixels, so EXIF never survives — strip_metadata is inherently satisfied), plus a generation edge: EMPTY_MIME → a blank 1024×1024 white canvas in any supported encoding (resize in the same statement — empty:png | image resize width=64). For webp/avif output or native-speed processing, compose a sharp-backed engine instead — the capability declaration is the seam.

jimp is an optional peer dependency, lazily imported on first actual use (constructing the engine — and therefore the pipeline — never loads it).

Interfaces

InterfaceDescription
JimpEngineOptionsOptions for jimpEngine.

Functions

FunctionDescription
jimpEngineConstruct the Jimp-backed image engine.