Profile picture generation service written in Go. A demo can be found at go-ppic.herokuapp.com.
go-ppic
provides two commands; ppicd
and ppic
.
ppicd
is a web server providing image generation.
go get -u github.com/jackwilsdon/go-ppic/cmd/ppicd
-d enable pprof debug routes
-h string
host to run the server on
-p uint
port to run the server on (default 3000)
-v enable verbose output
-z enable gzip compression
After starting up the server, you should see something similar to the following output;
2006/01/02 15:04:05 starting server on http://127.0.0.1:3000...
Visiting the URL that the server is running on will give you the image for an empty string. You can get the image for
the string "example" by visiting /example
on the server (http://127.0.0.1:3000/example
in this case).
The server accepts the following query parameters to change the response;
?size=N
→ specify the size of the image to return (must be a multiple of 8)?monochrome
→ change the image to black and white
By default the server will respond in PNG format, but it also supports the following file extensions;
.gif
.jpeg
ppic
is used to generate profile pictures on the command line, without having to run a web server. ppic
outputs the generated image to stdout.
go get -u github.com/jackwilsdon/go-ppic/cmd/ppic
usage: ppic text [size] > image.png
size
defaults to 512 if not provided
ppic jackwilsdon 1024 > profile.png