Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stuartpb/chachacat
Chained Hulling Algorithm for Convex Hull Area of Canvas Alpha Threshold
https://github.com/stuartpb/chachacat
Last synced: 7 days ago
JSON representation
Chained Hulling Algorithm for Convex Hull Area of Canvas Alpha Threshold
- Host: GitHub
- URL: https://github.com/stuartpb/chachacat
- Owner: stuartpb
- License: mit
- Created: 2015-07-24T07:45:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T22:27:23.000Z (6 months ago)
- Last Synced: 2024-07-09T03:21:40.508Z (6 months ago)
- Language: JavaScript
- Homepage: https://stuartpb.github.io/chachacat/demo.html
- Size: 205 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chachacat
Chained Hulling Algorithm for Convex Hull Area of Canvas Alpha Threshold
![Convex hull demo](https://cloud.githubusercontent.com/assets/572196/8876272/812cac00-31d3-11e5-900f-8322b41f294e.png)
This function calculates the [convex hull][] of pixels in a given image's alpha
channel (above a certain threshold - 64 by default) and returns the area of
that hull.[convex hull]: https://en.wikipedia.org/wiki/Convex_hull
This yields a decent approximation of the image content's area, in terms of
space occupied by the image. This can then be used for, say, normalizing the
size of icons on a menu, rather than [trusting developers to figure out][1],
which, in practice, doesn't really work.[1]: https://developer.chrome.com/docs/webstore/images#icon-size