Improve entropy-based crop docs based on feedback.

Fix includes to keep MSVC compiler happy.
Additional memory leak suppressions for latest V8.
This commit is contained in:
Lovell Fuller
2016-03-05 13:52:12 +00:00
parent 2034efcf55
commit 185fcfe635
5 changed files with 47 additions and 6 deletions

View File

@@ -138,11 +138,14 @@ Possible attributes of `sharp.gravity` are
`north`, `northeast`, `east`, `southeast`, `south`,
`southwest`, `west`, `northwest`, `center` and `centre`.
`sharp.strategy` currently contains only the experimental `entropy`,
which will retain the part of the image with the highest
[Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29) value.
Possible attributes of the experimental `sharp.strategy` are:
The default option is a `center`/`centre` gravity.
* `entropy`: resize so one dimension is at its target size
then repeatedly remove pixels from the edge with the lowest
[Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29)
until it too reaches the target size.
The default crop option is a `center`/`centre` gravity.
```javascript
var transformer = sharp()

View File

@@ -14,7 +14,7 @@
[#239](https://github.com/lovell/sharp/issues/239)
[@chrisriley](https://github.com/chrisriley)
* Add entropy-based strategy to determine crop region.
* Add entropy-based crop strategy to remove least interesting edges.
[#295](https://github.com/lovell/sharp/issues/295)
[@rightaway](https://github.com/rightaway)