https://github.com/jackwilsdon/go-ppic
A simple profile picture generator written in Go
https://github.com/jackwilsdon/go-ppic
go image-generator
Last synced: about 1 year ago
JSON representation
A simple profile picture generator written in Go
- Host: GitHub
- URL: https://github.com/jackwilsdon/go-ppic
- Owner: jackwilsdon
- License: agpl-3.0
- Created: 2018-09-10T23:29:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T19:58:47.000Z (over 3 years ago)
- Last Synced: 2024-06-20T10:14:43.123Z (almost 2 years ago)
- Topics: go, image-generator
- Language: Go
- Homepage: https://go-ppic.herokuapp.com
- Size: 1.42 MB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Profile picture generation service written in Go. A demo can be found at [go-ppic.herokuapp.com](https://go-ppic.herokuapp.com/hello).
`go-ppic` provides two commands; [`ppicd`](#ppicd) and [`ppic`](#ppic).
## ppicd
`ppicd` is a web server providing image generation.
### Installation
```Shell
go get -u github.com/jackwilsdon/go-ppic/cmd/ppicd
```
### Usage
```Text
-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;
```Text
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).
### URL Parameters
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
### Supported Extensions
By default the server will respond in PNG format, but it also supports the following file extensions;
* `.gif`
* `.jpeg`
## ppic
`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.
### Installation
```Shell
go get -u github.com/jackwilsdon/go-ppic/cmd/ppic
```
### Usage
```Text
usage: ppic text [size] > image.png
```
> `size` defaults to 512 if not provided
### Examples
```Shell
ppic jackwilsdon 1024 > profile.png
```