Docs: add example of 16-bit RGB output #2528

This commit is contained in:
Lovell Fuller
2021-01-26 15:03:43 +00:00
parent 573ed5f4b5
commit 24d9e53c3f
2 changed files with 15 additions and 0 deletions

View File

@@ -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]
### Examples
```javascript
// Output 16 bits per pixel RGB
await sharp(input)
.toColourspace('rgb16')
.toFile('16-bpp.png')
```
- Throws **[Error][4]** Invalid parameters