An attempt to replicate GitHub's default profile pictures in under 100 lines (excluding junk) using Fastify and Canvas
- Clone the repository
- Run
npm i
to install dependencies - Run
./start.sh
to transpile and start the server
Go to the root of the server (default: localhost:3000
) for usage instructions after running the server
Just using /pfp
(like: http://gitpfp.wav.blue/pfp ) without any parameters will generate a random string with 60 wh
(6 pixels across and down) and 10 magnification
name
- The text to base the profile picture onmag
- Image magnification of the output imagewh
- Width and Height value of the output imagecolour
- Hexadecimal colour code for the pixels of the output image (Without#
, e.g.?colour=e8c8e8
)
Note: For the best output, make sure
mag
andwh
are even numbers (like20
not27
,39
,15.323421
etc)
Output | Request |
---|---|
gitpfp.wav.blue/pfp?mag=1 |
|
gitpfp.wav.blue/pfp?mag=1&wh=100 |
|
gitpfp.wav.blue/pfp?mag=1&wh=200 |
|
gitpfp.wav.blue/pfp?mag=1&name=meow |
- GitHub for really cool profile pictures
- GitHub Co-Pilot for holding my hand with the super complex mathamatical stuff
- United States Naval Academy for the name list sample (
fillernames.txt
)