import { ImageDataLike, WasmSource } from "./common.js"; export declare enum ColorSpace { GRAYSCALE = 1, RGB = 2, YCbCr = 3 } export declare enum Quantization { JPEG_Annex_K = 0, Flat = 1, MSSIM_Tuned_Kodak = 2, ImageMagick = 3, PSNR_HVS_M_Tuned_Kodak = 4, Klein_Silverstein_Carney = 5, Watson_Taylor_Borthwick = 6, Ahumada_Watson_Peterson = 7, Peterson_Ahumada_Watson = 8 } export interface Options { /** * Compression quality [0..100], 5-95 is most useful range. * * @default 75 */ quality?: number; /** * Create baseline JPEG file (disable progressive coding). * * @default false */ baseline?: boolean; /** * Use arithmetic coding. * * @default false */ arithmetic?: boolean; /** * Create progressive JPEG file. * * @default true */ progressive?: boolean; /** * Optimize Huffman table (smaller file, but slow compression) * * @default true */ optimizeCoding?: boolean; /** * Smooth dithered input (N=1..100 is strength) * * @default 0 */ smoothing?: number; /** * @default ColorSpace.YCbCr */ colorSpace?: ColorSpace; /** * Select the predefined quantization table to use. * * @default Quantization.ImageMagick */ quantTable?: Quantization; /** * use scans in trellis optimization. * * @default false */ trellisMultipass?: boolean; /** * optimize for sequences of EOB */ trellisOptZero?: boolean; /** * optimize quant table in trellis loop. * * @default false */ trellisOptTable?: boolean; /** * number of trellis loops. * * @default 1 */ trellisLoops?: number; autoSubsample?: boolean; chromaSubsample?: number; separateChromaQuality?: boolean; chromaQuality?: number; } export declare const defaultOptions: Required; export declare const bitDepth: number[]; export declare const mimeType = "image/jpeg"; export declare const extension = "jpg"; export declare function loadEncoder(input?: WasmSource): Promise; export declare const loadDecoder: typeof loadEncoder; export declare function encode(image: ImageDataLike, options?: Options): Uint8Array; export declare function decode(input: BufferSource): ImageData;