33Image processing library.
44
55![ CI] ( https://github.com/Brooooooklyn/image/workflows/CI/badge.svg )
6- [ ![ install size] ( https://packagephobia.com/badge?p=@napi-rs/image )] ( https://packagephobia.com/result?p=@napi-rs/image )
7- [ ![ Downloads] ( https://img.shields.io/npm/dm/@napi-rs/image.svg?sanitize=true )] ( https://npmcharts.com/compare/@napi-rs/image?minimal=true )
86
97## Support matrix
108
@@ -23,69 +21,6 @@ Image processing library.
2321| Android armv7 | ✓ | ✓ | ✓ | ✓ | ✓ |
2422| FreeBSD x64 | ✓ | ✓ | ✓ | ✓ | ✓ |
2523
26- ## Lossless compression
24+ ## ` @napi-rs/image `
2725
28- ### ` PNG `
29-
30- ``` ts
31- export interface PNGLosslessOptions {
32- /**
33- * Attempt to fix errors when decoding the input file rather than returning an Err.
34- * Default: `false`
35- */
36- fixErrors? : boolean | undefined | null
37- /**
38- * Write to output even if there was no improvement in compression.
39- * Default: `false`
40- */
41- force? : boolean | undefined | null
42- /** Which filters to try on the file (0-5) */
43- filter? : Array <number > | undefined | null
44- /**
45- * Whether to attempt bit depth reduction
46- * Default: `true`
47- */
48- bitDepthReduction? : boolean | undefined | null
49- /**
50- * Whether to attempt color type reduction
51- * Default: `true`
52- */
53- colorTypeReduction? : boolean | undefined | null
54- /**
55- * Whether to attempt palette reduction
56- * Default: `true`
57- */
58- paletteReduction? : boolean | undefined | null
59- /**
60- * Whether to attempt grayscale reduction
61- * Default: `true`
62- */
63- grayscaleReduction? : boolean | undefined | null
64- /**
65- * Whether to perform IDAT recoding
66- * If any type of reduction is performed, IDAT recoding will be performed regardless of this setting
67- * Default: `true`
68- */
69- idatRecoding? : boolean | undefined | null
70- /** Whether to remove ***All non-critical headers*** on PNG */
71- strip? : boolean | undefined | null
72- /** Whether to use heuristics to pick the best filter and compression */
73- useHeuristics? : boolean | undefined | null
74- }
75- export function losslessCompressPng(input : Buffer , options ? : PNGLosslessOptions | undefined | null ): Buffer
76- ```
77-
78- ### ` JPEG `
79-
80- ` ` ` ts
81- export interface JpegCompressOptions {
82- /** Output quality, default is 100 (lossless) */
83- quality?: number | undefined | null
84- /**
85- * If true, it will use MozJPEG’s scan optimization. Makes progressive image files smaller.
86- * Default is ` true `
87- */
88- optimizeScans?: boolean | undefined | null
89- }
90- export function compressJpeg(input: Buffer, options?: JpegCompressOptions | undefined | null): Buffer
91- ` ` `
26+ See [ Documentation for ` @napi-rs/image ` ] ( ./packages/binding )
0 commit comments