Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evansque/polygonize
A fun tool to create geometric low poly art images
https://github.com/evansque/polygonize
Last synced: about 2 months ago
JSON representation
A fun tool to create geometric low poly art images
- Host: GitHub
- URL: https://github.com/evansque/polygonize
- Owner: evansque
- Created: 2016-11-15T17:25:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-05T22:10:22.000Z (almost 6 years ago)
- Last Synced: 2024-07-22T14:39:26.762Z (2 months ago)
- Language: JavaScript
- Homepage: https://codepen.io/EvanLevesque/pen/ObgOaV
- Size: 46.9 KB
- Stars: 50
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# polygonize
## Quickstart
Install with Bower
```
bower install polygonize --save
```Load the script files
``````
## API
```
Polygonize({
src: src,
cellSize: 10,
progress: function (progress) {
console.log(progress + '%');
},
onSuccess: function(canvas) {
const canvasContainer = document.getElementById('canvas-container')
canvasContainer.innerHTML = '';
canvasContainer.appendChild(canvas);
}
});
```* src (string): any acceptable image url or data url (must be [CORS enabled](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image))
* cellSize (int): grid cell size in pixels
* progress (function(int)): a callback function that will be called when image processing updates
* onSuccess (function(canvasElem)): a callback function that will be called when processing is done successfully
* onError (function()): a callback function that will be called when processing fails## Dependencies
* [delaunay](https://github.com/ironwallaby/delaunay)## Examples
## Development
clone and repository and then
```
npm install && bower install && npm start
```
Gulp server will start on port 8888## TODO
* Intensive JavaScript computations blocks the single thread## Issues ?
If you found any issues or if you have any ideas to improve this tool please don't hesitate to create a new issue on github.