https://github.com/taigrr/gopherbadgeimg
https://github.com/taigrr/gopherbadgeimg
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/taigrr/gopherbadgeimg
- Owner: taigrr
- Created: 2024-07-09T04:39:44.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T22:16:37.000Z (almost 2 years ago)
- Last Synced: 2025-03-06T14:31:07.939Z (over 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gopherbadgeimg
Simple, educational tool to transform images to the bitmap format supported by
the 2024 gophercon badger-w (and therefore most TinyGo devices!).
All of the most interesting bits in the code are heavily documented in-line.
Build the tool or install it using the following:
`go install github.com/taigrr/gopherbadgeimg@latest`
Run it as follows to generate a profile image:
`gopherbadgeimg profile image.jpg`
Or, for the splash screen:
`gopherbadgeimg splash image.jpg`
This will result in 3 different outputs:
1. In the [Makefile](https://github.com/hybridgroup/badger2040/blob/main/Makefile)
from the badge repo, you're allowed to replace the profile image by dropping in
base64-encoded pixel data.
This is printed to STDOUT by default, and can be pasted directly into the Makefile.
1. The generator will also create a .bin file, which can be embedded into your
code using `go:embed`. An example of this can be found in `main_test.go`.
1. Finally, the generator will also create a `*-generated.go` file similar to the
[tainigo.go](https://github.com/hybridgroup/badger2040/blob/main/tainigo.go) file,
to demonstrate an alternative to go embed.