All Projects → brandonasuncion → Pixel

brandonasuncion / Pixel

Licence: Apache-2.0 license
A real-time collaborative canvas, inspired by Reddit Place

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
Procfile
174 projects

Projects that are alternatives of or similar to Pixel

vue-pixel-art
Vue Pixel Art is an easy way to draw your Pixel Arts. This project is refactored from CSS Collection - DotGen
Stars: ✭ 40 (+53.85%)
Mutual labels:  pixel-art, pixel
Pixelorama
A free & open-source 2D sprite editor, made with the Godot Engine! Available on Windows, Linux, macOS and the Web!
Stars: ✭ 2,535 (+9650%)
Mutual labels:  pixel-art, pixel
Pxltrm
🖌️ pxltrm - [WIP] A pixel art editor inside the terminal
Stars: ✭ 459 (+1665.38%)
Mutual labels:  pixel-art, pixel
metal camera
iOS metal camera with GPU shaders.
Stars: ✭ 68 (+161.54%)
Mutual labels:  pixel-art, pixel
pixelart.js
punks.js - draw punk (pixel) art images using any design (in ascii text) in any colors; incl. 2x/4x/8x zoom for bigger sizes and more
Stars: ✭ 132 (+407.69%)
Mutual labels:  pixel-art, pixel
pixelino
Pixel-drawing app for iOS ✍️
Stars: ✭ 45 (+73.08%)
Mutual labels:  pixel-art, pixel
Pixel Editor
It edits pixels
Stars: ✭ 125 (+380.77%)
Mutual labels:  pixel-art, pixel
Pix
🎨 Pix is an online pixel art community where everyone can unleash their creativity on a 16x16 canvas, built with React-Native for iOS devices. 🚀
Stars: ✭ 86 (+230.77%)
Mutual labels:  pixel-art, pixel
Obelisk.js
Build pixel isometric graphics with HTML5 canvas
Stars: ✭ 2,213 (+8411.54%)
Mutual labels:  pixel-art, pixel
Vixl44
Create pixel art inside your terminal using vim movements
Stars: ✭ 152 (+484.62%)
Mutual labels:  pixel-art, pixel
Pixelizator
Swift/Python image pixelizer 🖼️.
Stars: ✭ 53 (+103.85%)
Mutual labels:  pixel-art, pixel
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (+92.31%)
Mutual labels:  pixel-art, pixel
Rx
👾 Modern and minimalist pixel editor
Stars: ✭ 2,063 (+7834.62%)
Mutual labels:  pixel-art, pixel
8192px
A collaborative pixel art experiment
Stars: ✭ 64 (+146.15%)
Mutual labels:  pixel-art, pixel
vscode-luna-paint
A raster image editor extension for VS Code
Stars: ✭ 235 (+803.85%)
Mutual labels:  pixel-art, pixel
borrow-bot
💰 A bot for maximizing the borrow subreddit
Stars: ✭ 26 (+0%)
Mutual labels:  reddit
aPRAW
Asynchronous Python Reddit API Wrapper
Stars: ✭ 49 (+88.46%)
Mutual labels:  reddit
today-AI-learned
Training a classifier to reddit's TIL to find new things on Wikipedia
Stars: ✭ 35 (+34.62%)
Mutual labels:  reddit
insta reddit bot
[UNMAINTAINED] A bot which pulls images from Reddit and uploads them to Instagram. Former source code of @me_irl_bot
Stars: ✭ 26 (+0%)
Mutual labels:  reddit
lemmur
🐒 A mobile client for lemmy
Stars: ✭ 228 (+776.92%)
Mutual labels:  reddit

Pixel

Build Status npm (scoped) Hex.pm

Pixel is a real-time collaborative canvas inspired off of Reddit's Place. It uses the EaselJS JavaScript library to interact with an HTML5 canvas element, and uses MongoDB to store pixel data. It's open source, and it's entirely scriptable!

Though, unlike Reddit Place, everything is anonymous. However, it can be configured to set a rate limit for each IP address.

Try it out yourself! A live demo is available!

Setup / Deployment

Deploy

General Setup

  1. Install the Node.js dependencies.

    $ npm install
    
  2. If your webserver is running on a different public server than the WebSocket server, modify src/public/scripts/pixel-config.js to point to your WebSocket server.
    eg.

    PIXEL_SERVER: "ws://127.0.0.1:3001",
  3. (Optional) Adjust the dimensions of the canvas, zoom settings, or even the color palette.

    CANVAS_WIDTH: 50,
    CANVAS_HEIGHT: 50,
    CANVAS_INITIAL_ZOOM: 20,
    CANVAS_MIN_ZOOM: 10,
    CANVAS_MAX_ZOOM: 40,
    CANVAS_COLORS: ["#eeeeee", "red", "orange", "yellow", "green", "blue", "purple", "#614126", "white", "black"]

    NOTE: The canvas size needs to be set in two places (one for the server and one for the browser). For the server set at the top of PixeServer.js, and for the browser set in pixel-config.js.

  4. (Optional) Enable MongoDB support by creating a database with a collection named pixels.
    When running the script, make sure the MONGODB_URI environment variable is set. In Heroku, it's under Settings -> Config Variables.
    Note: If the MongoDB URI is not set, all pixel data will only be kept in memory and will not be saved after a script reload.

Deployment

  1. Run the WebSocket server.
    $ npm start
    
  2. Upload the src/public/ folder to your webserver of choice.

Dependencies

PixelSocket Scripting and Automation

Pixel can be manipulated with the PixelSocket class (included in PixelSocket.js).

Constructor and Methods:

  • PixelSocket(server, autoconnect = false)
    Creates a PixelSocket object for the specified server. If autoconnect is set to true, it connects automatically.

  • PixelSocket.connect()
    Connects to server specified in the constructor

  • PixelSocket.sendPixel(x, y, colorID)
    Sends a paint request to the server with the specified coordinates and color ID

  • PixelSocket.getPixel(x, y)
    Tells the server that we need to update a specific pixel

  • PixelSocket.setMessageHandler(callback)
    Specify the handler for client commands from the server eg. ps.setMessageHandler(function(data){ ... }) "data" is a JS object containing an "action" attribute, specifying the type of message

    • Action: canvasInfo
      Server sends updated canvas dimensions
      Attributes: 'width', 'height'

    • Action: updatePixel
      Server notifies the client a pixel was updated with coordinates
      Attributes: 'x', 'y', 'color'

    • Action: timer
      Server sends the time when the next pixel can be drawn
      Attributes: 'time', 'type'

  • PixelSocket.setCanvasRefreshHandler(callback)
    Specify the handler used for complete canvas refreshes

  • PixelSocket.requestRefresh()
    Tells the server that we need to refresh the entire canvas, and to resend all the pixel data

Event Methods:

  • PixelSocket.onopen(event)
  • PixelSocket.onerror(event)
  • PixelSocket.onclose(event)

Acknowlegements

Reddit Place

License

Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].