Docs, changelog for top/left overlayWith offset #473

This commit is contained in:
Lovell Fuller 2016-07-05 11:17:41 +01:00
parent 278273b5c3
commit c9d32e22d3
3 changed files with 11 additions and 2 deletions

View File

@ -400,8 +400,8 @@ sharp(input)
}) })
.raw() .raw()
.toBuffer(function(err, data, info) { .toBuffer(function(err, data, info) {
// data contains the raw pixel data representing the input image // data contains the raw pixel data representing the convolution
// convolved with the horizontal Sobel operator // of the input image with the horizontal Sobel operator
}); });
``` ```
@ -457,9 +457,13 @@ Overlay (composite) a image containing an alpha channel over the processed (resi
`options`, if present, is an Object with the following optional attributes: `options`, if present, is an Object with the following optional attributes:
* `gravity` is a String or an attribute of the `sharp.gravity` Object e.g. `sharp.gravity.north` at which to place the overlay, defaulting to `center`/`centre`. * `gravity` is a String or an attribute of the `sharp.gravity` Object e.g. `sharp.gravity.north` at which to place the overlay, defaulting to `center`/`centre`.
* `top` is an integral Number representing the pixel offset from the top edge.
* `left` is an integral Number representing the pixel offset from the left edge.
* `tile` is a Boolean, defaulting to `false`. When set to `true` repeats the overlay image across the entire image with the given `gravity`. * `tile` is a Boolean, defaulting to `false`. When set to `true` repeats the overlay image across the entire image with the given `gravity`.
* `cutout` is a Boolean, defaulting to `false`. When set to `true` applies only the alpha channel of the overlay image to the image to be overlaid, giving the appearance of one image being cut out of another. * `cutout` is a Boolean, defaulting to `false`. When set to `true` applies only the alpha channel of the overlay image to the image to be overlaid, giving the appearance of one image being cut out of another.
If both `top` and `left` are provided, they take precedence over `gravity`.
```javascript ```javascript
sharp('input.png') sharp('input.png')
.rotate(180) .rotate(180)

View File

@ -30,6 +30,10 @@ Requires libvips v8.3.1
[#456](https://github.com/lovell/sharp/pull/456) [#456](https://github.com/lovell/sharp/pull/456)
[@kapouer](https://github.com/kapouer) [@kapouer](https://github.com/kapouer)
* Add top/left offset support to overlayWith operation.
[#473](https://github.com/lovell/sharp/pull/473)
[@rnanwani](https://github.com/rnanwani)
* Add convolve operation for kernel-based convolution. * Add convolve operation for kernel-based convolution.
[#479](https://github.com/lovell/sharp/pull/479) [#479](https://github.com/lovell/sharp/pull/479)
[@mhirsch](https://github.com/mhirsch) [@mhirsch](https://github.com/mhirsch)

View File

@ -96,6 +96,7 @@ the help and code contributions of the following people:
* [F. Orlando Galashan](https://github.com/frulo) * [F. Orlando Galashan](https://github.com/frulo)
* [Kleis Auke Wolthuizen](https://github.com/kleisauke) * [Kleis Auke Wolthuizen](https://github.com/kleisauke)
* [Matt Hirsch](https://github.com/mhirsch) * [Matt Hirsch](https://github.com/mhirsch)
* [Rahul Nanwani](https://github.com/rnanwani)
Thank you! Thank you!