image-js
Version:
Image processing and manipulation in JavaScript
31 lines • 1.07 kB
TypeScript
import type { Image } from '../Image.js';
import type { Mask } from '../Mask.js';
import type { EncodeJpegOptions } from './encodeJpeg.js';
import type { EncodePngOptions } from './encodePng.js';
export declare const ImageFormat: {
readonly PNG: "png";
readonly JPG: "jpg";
readonly JPEG: "jpeg";
readonly BMP: "bmp";
};
export type ImageFormat = (typeof ImageFormat)[keyof typeof ImageFormat];
export interface EncodeOptionsPng {
format: 'png';
encoderOptions?: EncodePngOptions;
}
export interface EncodeOptionsJpeg {
format: 'jpg' | 'jpeg';
encoderOptions?: EncodeJpegOptions;
}
export interface EncodeOptionsBmp {
format: 'bmp';
}
export declare const defaultPng: EncodeOptionsPng;
/**
* Encodes the image to the specified format
* @param image - Image to encode.
* @param options - Format and options passed to the encoder.
* @returns The encoded image.
*/
export declare function encode(image: Image | Mask, options?: EncodeOptionsBmp | EncodeOptionsPng | EncodeOptionsJpeg): Uint8Array;
//# sourceMappingURL=encode.d.ts.map