mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
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:
11
docs/api.md
11
docs/api.md
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user