33### Table of Contents
44
55- [ background] [ 1 ]
6- - [ greyscale] [ 2 ]
7- - [ grayscale] [ 3 ]
8- - [ toColourspace] [ 4 ]
9- - [ toColorspace] [ 5 ]
6+ - [ tint] [ 2 ]
7+ - [ greyscale] [ 3 ]
8+ - [ grayscale] [ 4 ]
9+ - [ toColourspace] [ 5 ]
10+ - [ toColorspace] [ 6 ]
1011
1112## background
1213
@@ -19,10 +20,24 @@ The alpha value is a float between `0` (transparent) and `1` (opaque).
1920
2021** Parameters**
2122
22- - ` rgba ` ** ([ String] [ 6 ] \| [ Object] [ 7 ] )** parsed by the [ color] [ 8 ] module to extract values for red, green, blue and alpha.
23+ - ` rgba ` ** ([ String] [ 7 ] \| [ Object] [ 8 ] )** parsed by the [ color] [ 9 ] module to extract values for red, green, blue and alpha.
2324
2425
25- - Throws ** [ Error] [ 9 ] ** Invalid parameter
26+ - Throws ** [ Error] [ 10 ] ** Invalid parameter
27+
28+ Returns ** Sharp**
29+
30+ ## tint
31+
32+ Tint the image using the provided chroma while preserving the image luminance.
33+ An alpha channel may be present and will be unchanged by the operation.
34+
35+ ** Parameters**
36+
37+ - ` rgb ` ** ([ String] [ 7 ] \| [ Object] [ 8 ] )** parsed by the [ color] [ 9 ] module to extract chroma values.
38+
39+
40+ - Throws ** [ Error] [ 10 ] ** Invalid parameter
2641
2742Returns ** Sharp**
2843
@@ -37,7 +52,7 @@ An alpha channel may be present, and will be unchanged by the operation.
3752
3853** Parameters**
3954
40- - ` greyscale ` ** [ Boolean] [ 10 ] ** (optional, default ` true ` )
55+ - ` greyscale ` ** [ Boolean] [ 11 ] ** (optional, default ` true ` )
4156
4257Returns ** Sharp**
4358
@@ -47,7 +62,7 @@ Alternative spelling of `greyscale`.
4762
4863** Parameters**
4964
50- - ` grayscale ` ** [ Boolean] [ 10 ] ** (optional, default ` true ` )
65+ - ` grayscale ` ** [ Boolean] [ 11 ] ** (optional, default ` true ` )
5166
5267Returns ** Sharp**
5368
@@ -58,10 +73,10 @@ By default output image will be web-friendly sRGB, with additional channels inte
5873
5974** Parameters**
6075
61- - ` colourspace ` ** [ String] [ 6 ] ?** output colourspace e.g. ` srgb ` , ` rgb ` , ` cmyk ` , ` lab ` , ` b-w ` [ ...] [ 11 ]
76+ - ` colourspace ` ** [ String] [ 7 ] ?** output colourspace e.g. ` srgb ` , ` rgb ` , ` cmyk ` , ` lab ` , ` b-w ` [ ...] [ 12 ]
6277
6378
64- - Throws ** [ Error] [ 9 ] ** Invalid parameters
79+ - Throws ** [ Error] [ 10 ] ** Invalid parameters
6580
6681Returns ** Sharp**
6782
@@ -71,31 +86,33 @@ Alternative spelling of `toColourspace`.
7186
7287** Parameters**
7388
74- - ` colorspace ` ** [ String] [ 6 ] ?** output colorspace.
89+ - ` colorspace ` ** [ String] [ 7 ] ?** output colorspace.
7590
7691
77- - Throws ** [ Error] [ 9 ] ** Invalid parameters
92+ - Throws ** [ Error] [ 10 ] ** Invalid parameters
7893
7994Returns ** Sharp**
8095
8196[ 1 ] : #background
8297
83- [ 2 ] : #greyscale
98+ [ 2 ] : #tint
99+
100+ [ 3 ] : #greyscale
84101
85- [ 3 ] : #grayscale
102+ [ 4 ] : #grayscale
86103
87- [ 4 ] : #tocolourspace
104+ [ 5 ] : #tocolourspace
88105
89- [ 5 ] : #tocolorspace
106+ [ 6 ] : #tocolorspace
90107
91- [ 6 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
108+ [ 7 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
92109
93- [ 7 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
110+ [ 8 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
94111
95- [ 8 ] : https://www.npmjs.org/package/color
112+ [ 9 ] : https://www.npmjs.org/package/color
96113
97- [ 9 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
114+ [ 10 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error
98115
99- [ 10 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
116+ [ 11 ] : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
100117
101- [ 11 ] : https://github.com/jcupitt/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568
118+ [ 12 ] : https://github.com/jcupitt/libvips/blob/master/libvips/iofuncs/enumtypes.c#L568
0 commit comments