|
1 | 1 | # smartcrop.js
|
2 | 2 |
|
3 |
| -**:warning: This is a work in progress. Neither the API nor the algorithm are finished or battle proofen.** |
4 |
| - |
5 | 3 | Smartcrop.js implements an algorithm to find good crops for images.
|
6 | 4 |
|
7 | 5 | 
|
8 | 6 | Image: [https://www.flickr.com/photos/endogamia/5682480447/](https://www.flickr.com/photos/endogamia/5682480447) by N. Feans
|
9 | 7 |
|
10 |
| -It does this using fairly dumb image processing. In short: |
| 8 | +## Demos |
| 9 | +* [Test Suite](http://29a.ch/sandbox/2014/smartcrop/examples/testsuite.html), contains over 100 images, **heavy** |
| 10 | +* [Test Bed](http://29a.ch/sandbox/2014/smartcrop/examples/testbed.html), allows you to upload your own images |
| 11 | +* [Photo transitions](http://29a.ch/sandbox/2014/smartcrop/examples/slideshow.html), automatically creats ken burns transitions for a slide show. |
| 12 | + |
| 13 | +## Algorithm Overview |
| 14 | +Smartcrop.js works using fairly dumb image processing. In short: |
11 | 15 |
|
12 | 16 | 1. Find edges using laplace
|
13 | 17 | 1. Find regions with a color like skin
|
14 | 18 | 1. Find regions high in saturation
|
15 |
| -1. Generate a set of candidate crops |
| 19 | +1. Generate a set of candidate crops using a sliding window |
16 | 20 | 1. Rank them using a importance function to focus the detail in the center
|
17 | 21 | and avoid it in the edges.
|
18 | 22 | 1. Output the candidate crop with the highest rank
|
19 | 23 |
|
20 |
| -## Demos |
21 |
| -* [Test Suite](http://29a.ch/sandbox/2014/smartcrop/examples/testsuite.html), contains over 100 images, **heavy** |
22 |
| -* [Test Bed](http://29a.ch/sandbox/2014/smartcrop/examples/testbed.html), allows you to upload your own images |
23 |
| -* [Photo transitions](http://29a.ch/sandbox/2014/smartcrop/examples/slideshow.html), automatically creats ken burns transitions for a slide show. |
24 | 24 |
|
25 | 25 | ## Simple Example
|
26 | 26 | ```javascript
|
|
0 commit comments