Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zt-sv/schwartz.js
ASCII Art JavaScript library
https://github.com/zt-sv/schwartz.js
character-art image-processing javascript schwartz
Last synced: 2 months ago
JSON representation
ASCII Art JavaScript library
- Host: GitHub
- URL: https://github.com/zt-sv/schwartz.js
- Owner: zt-sv
- License: mit
- Created: 2014-09-11T07:38:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T09:16:31.000Z (over 9 years ago)
- Last Synced: 2024-11-10T20:37:46.464Z (2 months ago)
- Topics: character-art, image-processing, javascript, schwartz
- Language: JavaScript
- Homepage: http://13rentgen.github.io/schwartz.js
- Size: 6.34 MB
- Stars: 18
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[schwartz.js](http://13rentgen.github.io/schwartz.js) [![Build Status](https://travis-ci.org/13rentgen/schwartz.js.svg)](https://travis-ci.org/13rentgen/schwartz.js)
========May the schwartz be with you!
sCHwARTz - Character Art
## Installation
Install with [bower](http://bower.io/)
`bower install schwartz.js`## API spec
### Constructor
````javascript
Schwartz new Schwartz(
[Object options]
)
````
#### Options##### options.inverse
Type: `Boolean`
Default: FalseInverse image
##### options.detail
Type: `Nubmer`
Default: 50Depth of detail
##### options.render
Type: `Function`Output callback
### Generate character art from image source
````javascript
void generateFromImage(
String src
)
````### Generate character art from video
````javascript
void generateFromVideo(
DOMElement video
)
````### Set up depth of detail
````javascript
void setDetail(
Number n
)
````### Set up characters
````javascript
void setCharSet(
String str
)
````### Inverse image
````javascript
void inverseImage()
````##Usage Examples
### Generate from image
````javascript
var
body = document.getElementsByTagName('body')[0],render = function() {
//
},schwartz = new Schwartz({
render: render,
detail: 60
});
// end of varsschwartz.generateFromImage('/path/to/img.jpg');
````### Generate from video
````javascript
var
body = document.getElementsByTagName('body')[0],
video = document.getElementsByTagName('video')[0],render = function() {
//
},schwartz = new Schwartz({
render: render,
inverse: true,
detail: 50
});
// end of varsschwartz.generateFromVideo(video);
````## License
Copyright (c) 2014 Alexandr Zaytcev. Licensed under the MIT license.