Use bounding box of alpha+non-alpha for trim op #2166

This commit is contained in:
Lovell Fuller
2022-07-05 18:19:17 +01:00
parent e3cab7f10f
commit e0d3c6e05d
8 changed files with 44 additions and 14 deletions

View File

@@ -236,7 +236,8 @@ Returns **Sharp**
## trim
Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any.
Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels.
The `info` response Object, obtained from callback of `.toFile()` or `.toBuffer()`,
will contain `trimOffsetLeft` and `trimOffsetTop` properties.

View File

@@ -8,6 +8,9 @@ Requires libvips v8.13.0
* Drop support for Node.js 12, now requires Node.js >= 14.15.0.
* Use combined bounding box of alpha and non-alpha channels for `trim` operation.
[#2166](https://github.com/lovell/sharp/issues/2166)
* Re-introduce support for greyscale ICC profiles (temporarily removed in 0.30.2).
[#3114](https://github.com/lovell/sharp/issues/3114)

File diff suppressed because one or more lines are too long