2.3.1 • Published 4 months ago

ag-images v2.3.1

Weekly downloads
21
License
MIT
Repository
github
Last release
4 months ago

ag-images

Library for loading and saving PNG files

npm install ag-images

# for compatibility with Node < 20, use npm install ag-images@^1.0.0
// main functions
export function encodePNG(width: number, height: number, data: Buffer, options?: PngConfig): Promise<Buffer>;
export function decodePNG(data: Buffer): Promise<DecodedImageData>;

export interface DecodedImageData {
	width: number;
	height: number;
	data: Buffer;
}

export interface PngConfig {
	compressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
	filters?: number;
	palette?: Uint8ClampedArray;
	backgroundIndex?: number;
	resolution?: number;
}

// filters constants
export const PNG_NO_FILTERS: number;
export const PNG_ALL_FILTERS: number;
export const PNG_FILTER_NONE: number;
export const PNG_FILTER_SUB: number;
export const PNG_FILTER_UP: number;
export const PNG_FILTER_AVG: number;
export const PNG_FILTER_PAETH: number;
2.3.0

4 months ago

2.3.1

4 months ago

2.2.2

4 months ago

2.2.0

4 months ago

2.1.1

6 months ago

2.1.0

6 months ago

2.0.0

6 months ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago