Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neilseligmann/canvasbot
A Canvas Bot originally made for https://github.com/xSke/Pxls.
https://github.com/neilseligmann/canvasbot
bot canvas javascript nodejs pxls
Last synced: about 12 hours ago
JSON representation
A Canvas Bot originally made for https://github.com/xSke/Pxls.
- Host: GitHub
- URL: https://github.com/neilseligmann/canvasbot
- Owner: NeilSeligmann
- License: mit
- Created: 2017-04-18T17:24:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-18T19:28:28.000Z (over 7 years ago)
- Last Synced: 2023-11-29T21:29:31.981Z (12 months ago)
- Topics: bot, canvas, javascript, nodejs, pxls
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CanvasBot
This bot is meant for https://github.com/xSke/Pxls.This bot will automatically print an image of your choosing in the canvas with a certain delay per pixel drawn.
# Requirements
- Node.js
- An Image (Only JPG or PNG)
- A Web Browser with a Developer Console that supports interacting with the page's javascript.
__(Chrome, Firefox and most standard web browsers will do)__# Instructions
## Install
- Go to the root of the project.
- Execute from the command line:
```
npm install
```
This will install al the necessary modules.## Step 1
- Get an image of your choosing and process it using:
```
node index.js path_to_your_file
```
This will output a JSON string with the image's pixels information to __output.txt__.
By default the script will ignore whites, because the background is usually white, __if you wish to also print the whites add "*full*" to the arguments__.
```
node index.js path_to_your_file full
```## Step 2
- Open the file __js.js__, this file contains the javascript that you will have to use in the browser.
- Replace the __data__ varaible with the JSON string from __output.txt__.
- Copy the whole script.## Step 3
Finally, you will execute the script in the browser. You can do this by *__pasting the script in the console__ or using something like __TamperMonkey__*.
- Goto the Site with the Canvas you want to draw on.
- Open the __Developer Console__
- Paste the script from __js.js__
- Execute the script by entering in the console
```
nextPixel();
```### Done! You should now see the color changing and the pixels appearing in the canvas.