mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: add example of 16-bit RGB output #2528
This commit is contained in:
parent
573ed5f4b5
commit
24d9e53c3f
@ -48,6 +48,14 @@ By default output image will be web-friendly sRGB, with additional channels inte
|
|||||||
|
|
||||||
- `colourspace` **[string][1]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][6]
|
- `colourspace` **[string][1]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][6]
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Output 16 bits per pixel RGB
|
||||||
|
await sharp(input)
|
||||||
|
.toColourspace('rgb16')
|
||||||
|
.toFile('16-bpp.png')
|
||||||
|
```
|
||||||
|
|
||||||
- Throws **[Error][4]** Invalid parameters
|
- Throws **[Error][4]** Invalid parameters
|
||||||
|
|
||||||
|
@ -57,6 +57,13 @@ function grayscale (grayscale) {
|
|||||||
/**
|
/**
|
||||||
* Set the output colourspace.
|
* Set the output colourspace.
|
||||||
* By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
|
* By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* // Output 16 bits per pixel RGB
|
||||||
|
* await sharp(input)
|
||||||
|
* .toColourspace('rgb16')
|
||||||
|
* .toFile('16-bpp.png')
|
||||||
|
*
|
||||||
* @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://github.com/libvips/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568)
|
* @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://github.com/libvips/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568)
|
||||||
* @returns {Sharp}
|
* @returns {Sharp}
|
||||||
* @throws {Error} Invalid parameters
|
* @throws {Error} Invalid parameters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user