Skip to content

An attempt at creating an implementation of the r/Place experiment in Go with help from Redis for 24 bit colour support

License

Notifications You must be signed in to change notification settings

wyattjoh/heximage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heximage

Go Doc Go Report

This serves as a mimic of the api provided during the reddit.com/r/place experiment. It exposes a few web api's, a websocket interface, as well as a cli interface to editing, displaying, and fetching images stored in Redis and modified using it's BITFIELD command.

Endpoints

  • GET /api/place/live: websocket api
  • POST /api/place/draw: post json with content {"X": "1", "Y": "1", "Colour": "FFFFFFFF"} to set a pixel's colour
  • GET /api/place/board-bitmap: get the bit repr of the image in raw bytes
  • GET /api/place/board?w=: get the png repr of the image, optional w allows you to set any width for the image to be resized to

Running

You can run the application simply by running go get:

go get github.com/wyattjoh/heximage

And running:

$ heximage server --help
NAME:
   heximage server - serves the heximage server

USAGE:
   heximage server [command options] [arguments...]

OPTIONS:
   --listen-addr value          address for the server to listen on (default: "127.0.0.1:8080")
   --allowed-cors-origin value  allow one or many origins to access the api

For an example of the application in action, visit the example directory.

All other commands can be explored by looking through the usage information available via --help on each command and subcommand.

License

MIT

About

An attempt at creating an implementation of the r/Place experiment in Go with help from Redis for 24 bit colour support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages