mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 08:47:31 +00:00
Merge pull request #1021 from atjn/documentation-fixes
This commit is contained in:
@@ -5,7 +5,7 @@ by various image compressors.
|
|||||||
|
|
||||||
# API & CLI
|
# API & CLI
|
||||||
|
|
||||||
Squoosh now has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/api) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) that allows you to compress many images at once.
|
Squoosh now has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/libsquoosh) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) that allows you to compress many images at once.
|
||||||
|
|
||||||
# Privacy
|
# Privacy
|
||||||
|
|
||||||
|
|||||||
@@ -55,5 +55,5 @@ $ npx @squoosh/cli --wp2 auto test.png
|
|||||||
```
|
```
|
||||||
|
|
||||||
[squoosh]: https://squoosh.app
|
[squoosh]: https://squoosh.app
|
||||||
[codecs.js]: https://github.com/GoogleChromeLabs/squoosh/blob/dev/cli/src/codecs.js
|
[codecs.js]: https://github.com/GoogleChromeLabs/squoosh/blob/dev/libsquoosh/src/codecs.js
|
||||||
[butteraugli]: https://github.com/google/butteraugli
|
[butteraugli]: https://github.com/google/butteraugli
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const imagePath = 'path/to/image.png';
|
|||||||
const image = imagePool.ingestImage(imagePath);
|
const image = imagePool.ingestImage(imagePath);
|
||||||
```
|
```
|
||||||
|
|
||||||
These `ingestImage` function can take anything the node [`readFile`][readfile] function can take, uncluding a buffer and `FileHandle`.
|
The `ingestImage` function can take anything the node [`readFile`][readfile] function can take, uncluding a buffer and `FileHandle`.
|
||||||
|
|
||||||
The returned `image` object is a representation of the original image, that you can now preprocess, encode, and extract information about.
|
The returned `image` object is a representation of the original image, that you can now preprocess, encode, and extract information about.
|
||||||
|
|
||||||
@@ -151,13 +151,13 @@ libSquoosh has an _experimental_ auto optimizer that compresses an image as much
|
|||||||
|
|
||||||
You can make use of the auto optimizer by using “auto” as the config object.
|
You can make use of the auto optimizer by using “auto” as the config object.
|
||||||
|
|
||||||
```
|
```js
|
||||||
const encodeOptions: {
|
const encodeOptions: {
|
||||||
mozjpeg: 'auto',
|
mozjpeg: 'auto',
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
[squoosh]: https://squoosh.app
|
[squoosh]: https://squoosh.app
|
||||||
[codecs.js]: https://github.com/GoogleChromeLabs/squoosh/blob/dev/cli/src/codecs.js
|
[codecs.js]: https://github.com/GoogleChromeLabs/squoosh/blob/dev/libsquoosh/src/codecs.js
|
||||||
[butteraugli]: https://github.com/google/butteraugli
|
[butteraugli]: https://github.com/google/butteraugli
|
||||||
[readfile]: https://nodejs.org/api/fs.html#fs_fspromises_readfile_path_options
|
[readfile]: https://nodejs.org/api/fs.html#fs_fspromises_readfile_path_options
|
||||||
|
|||||||
Reference in New Issue
Block a user