Sprator
This is a TypeScript implementation of Sprator (original is C++).
Sprator is a npm package to generate sprites using cellular automaton. Generated sprites is given as Buffer object in Node.js.
This image is from original Sprator repo.
Installation
You can install this package via npm.
npm install sprator
Requirement
Node.js v10 or higher.
Sprator Server
This package includes simple server using express. You can use it locally by following command.
npm start
Then the server is on http://localhost:3000
The server responds to GET request with any URL and accepts by following queries.
Query
Example
seed
Random string represents seed of generation.
Default: empty string
dot
Number of dots in an edge. 6 or more (must be even)
Default: 10
ppd
Numbrer of pixels in a dot. e.g. If dot=10 and ppd=4, the image pattern size is 40x40, and output image size is 64x64 (includes 12px margin).
Default: 10
fill
Fill color can be used on the Canvas.
You must encode
#
(%23
) on URL.
Default: #228b22
border
Border color can be used on the Canvas.
Default: #2f4f4f
background
Background color can be used on the Canvas.
Default: #000000
Usage
License
Sprator is licensed under the MIT license. See the LICENSE for more information.