Improve tint luminance with weighting function (#3859)

Co-authored-by: John Cupitt <jcupitt@gmail.com>
This commit is contained in:
Lovell Fuller
2023-11-19 13:19:34 +00:00
committed by GitHub
parent 139e4b9f65
commit 3f7313d031
17 changed files with 70 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
## tint
> tint(rgb) ⇒ <code>Sharp</code>
> tint(tint) ⇒ <code>Sharp</code>
Tint the image using the provided chroma while preserving the image luminance.
Tint the image using the provided colour.
An alpha channel may be present and will be unchanged by the operation.
@@ -12,7 +12,7 @@ An alpha channel may be present and will be unchanged by the operation.
| Param | Type | Description |
| --- | --- | --- |
| rgb | <code>string</code> \| <code>Object</code> | parsed by the [color](https://www.npmjs.org/package/color) module to extract chroma values. |
| tint | <code>String</code> \| <code>Object</code> | Parsed by the [color](https://www.npmjs.org/package/color) module. |
**Example**
```js

View File

@@ -20,6 +20,10 @@ Requires libvips v8.15.0
* Options for `trim` operation must be an Object, add new `lineArt` option.
[#2363](https://github.com/lovell/sharp/issues/2363)
* Improve luminance of `tint` operation with weighting function.
[#3338](https://github.com/lovell/sharp/issues/3338)
[@jcupitt](https://github.com/jcupitt)
* Ensure all `Error` objects contain a `stack` property.
[#3653](https://github.com/lovell/sharp/issues/3653)

File diff suppressed because one or more lines are too long