taigrr / gopherbadgeimg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/gopherbadgeimage@v1.0.0

Run it as follows to generate a profile image:

gopherbadgeimag profile image.jpg

Or, for the splash screen:

gopherbadgeimg splash image.jpg

This will result in 3 different outputs:

  1. In the 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.
  2. 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.
  3. Finally, the generator will also create a *-generated.go file similar to the tainigo.go file, to demonstrate an alternative to go embed.

About


Languages

Language:Go 100.0%