Skip to content
1 min read · 108 words

Interface: RawImageLike

Defined in: src/batteries/generation/transformers_js/helpers.ts:25

The exact toBlob/toSharp surface this helper reads off a resolved RawImage-like value.

Properties

PropertyTypeDescriptionDefined in
toBlob?(type?: string, quality?: number) => Promise<Blob>Browser-only: encodes the image to a Blob of the given MIME type. Throws outside a web env.src/batteries/generation/transformers_js/helpers.ts:27
toSharp?() => { png: () => { toBuffer: () => Promise<Buffer<ArrayBufferLike>>; }; }Node-only: wraps the raw pixel data in a sharp.Sharp instance. Throws inside a web env.src/batteries/generation/transformers_js/helpers.ts:29