Add an image to badger2040

ok, i just got a Badger2040 and i am working through it. unfortunately i am new to all things coding. is there anyplace that has a step by step guide on how to add and change images on it. i would like to just figure out how to change the badger in the Badge app to start. I have been able to tweak the QR code, list, and badge info since they are just text files, but the image portion is kicking my butt. any help would be awesome!


I don’t have my badger yet (it’s on the way…) so I haven’t actually played with it.

Are you going through the scamples here: Getting Started with Badger 2040
There’s a part that covers converting the images, lower down it’s got a section BAGDE.PY that tells you how to change the name and the image. It’s also mentioned in github here: pimoroni-pico/micropython/examples/badger2040 at main · pimoroni/pimoroni-pico · GitHub

1 Like

i stumbled on that late last night. i am able to get the standard images to work but the badge image is still eluding me. i have resized in GIMP and followed along with what it says to no result.

I have tried many of the same things to my knowledge, I am following correctly, but am unable to get the image to load correctly, right now, its just a bunch of horizontal slightly skewed lines… :/

Ok, I have octouple checked now, the image is in 104x128, and I have exported as 1 bit depth, png.
I am not sure what else I could do to make sure it will work?

It is all explained here, as previously commented by @baralong. You have to create a 104x128 image in JPG or PNG format. It doesn’t need to be 1 bit depth.
Afterwards, you convert the image with the command
python3 --binary badge-image.png (without the --resize option)
and you will get file badge-image.bin. Copy the file on / and you’ll see the image on the Badge application.
It worked perfectly for me.

Check your image dimensions have width and height the correct way round perhaps? Needs to be 104 pixels in width and 128 pixels in height (also, as @ffedericoni says, make sure you’re not using --resize, if you use that flag it will stretch the image to be too big).

Yeah… funny story, I realized while converting that the name output wasn’t or cannot be set… so I was redoing a file that worked… and using a file that didn’t :P
One suggestion for anyone having this issue, make sure you have exported the right size, AND renamed your “correct” file…


so i finally figured it out, i was using GIMP to resize the image and then saving it, this creates some weird file type. i had to go in and edit it and then export it back to the original file instead of saving it, then everything worked as stated in the “get started”

1 Like