Running for its third year, the GB Pixel Art Jam hosted by Bad_Dad and GB Studio Central invites artists to submit a single work of pixel art that fits the restrictions of a Game Boy screen. Each image must be 160 x 144 pixels in resolution, and no more than 4 colors total. The Jam also adds a limit on the number of unique 8×8 tiles used in a piece, with no more than 192 present. This limitation reflects how GB Studio works, as a typical background has 256 tiles, but 64 are reserved to text and UI art.
Each year the Jam introduces a theme to help inspire participants, and for the 2024 Jam the theme was “Color”, with four separate color palettes available for the artist to choose from. Unlike other Jams, there is no competitive piece to this event. All qualifying entries are compiled in a Gallery “Game” made for the Game Boy, available both digitally as a ROM file to download and as a physical cart thanks to insideGadgets.
Taking all the submissions and compiling the ROM is a multistep process, one that has evolved and improved with each iteration. While GB Studio provides a wonderful and simple interface to create such an experience, having to manually create every scene, credit and control for the game would be a time consuming experience thanks to the number of entries (374 in 2024 for example), so scripting tools were developed to help the process along.
Validation
Since there are parameters for each submission to meet, in terms of resolution, color depth and tile count, each piece of work needs to be validated for entry. For 2024, the team at GB Studio Central divided up the work to manually inspect each piece. Resolution is easy to ascertain from the file information, and tools like https://townsean.github.io/canvas-pixel-color-counter/ and https://gb-studio-tile-count.netlify.app/ can be used for the other two parameters. With a good number of people, validation didn’t take too long. Participants were then informed of any issues with their submission and given some time to try and correct it.
Going forward, a more automated approach is being used. Using Python, a script was created to perform the repetitive tasks of checking file type, resolution, color depth and tile count. Specific libraries like pypng and img2gb were instrumental in these tasks. Getting all the files from itch was also automated, utilizing the https://github.com/DragoonAethis/itch-dl tool, which grabs all the publicly available submissions from the Jam.
To keep all the data easy to parse, the python script read all the submission information from a CSV downloaded from itch, and then also outputted a CSV outlining any issues with the submission.

Example of the code used to validate the image submissions
The GB Studio Project Format
In order to understand the next steps in creating the Gallery ROM, it’s important to know how GB Studio stores project data. In previous versions, the entire project was stored in one giant project file, but now projects are broken down into folders and specific .gbres files. Each one of these is a JSON formatted text file with values pertaining to the resource in question, and a .bak file which is simply a copy of the most recent save for backup purposes in case something breaks. These files can all be edited with a simple text editor, but if the JSON format is not respected, an errant colon, comma or bracket can break the whole project.

The GB Studio Project file structure
Since these are all text files, we can also generate them using a python script. So for the Gallery ROM, a specific workflow was followed. First we needed to have all the background .gbres files generated by GB Studio. This required the following steps:
- Create a new blank GB Studio Project.
- Organize all the submitted PNGs into a single folder, naming them sequentially with the artist’s name appended (this was done with a python script as well).
- Add these PNGs to the /assets/backgrounds folder within the GB Studio main project folder.
- Reload the project to generate each one of those .gbres files in /project/backgrounds
Opening up a .gbres file, we can see the following information:
{
"_resourceType": "background",
"id": "d73b9946-7da0-4792-8e6d-43a29069ca59",
"name": "001_2k6-games",
"symbol": "bg_gbassets_001_2k6_games",
"width": 20,
"height": 18,
"imageWidth": 160,
"imageHeight": 144,
"filename": "001_2k6-games.png",
"tileColors": "",
"autoColor": false
}Most of these attributes are self explanatory, but pay attention to the “id” key. This is a randomly generated hash value that’s built with hexadecimal pairs. Almost every unique item in a GB Studio project will have a unique ID that’s associated with it. This makes sure that if you rename things in the project, links to the items don’t break.
If we create a simple scene we can find the following information in its .gbres file (found in /project/scenes):
{
"_resourceType": "scene",
"id": "59295cc5-41bc-48c9-980d-f8376ed85c9f",
"_index": 0,
"name": "Scene 1",
"backgroundId": "1e5f9d6a-bdbc-43e6-8c34-22f5bb5dea05",
"tilesetId": "",
"width": 20,
"height": 18,
"type": "TOPDOWN",
"paletteIds": [],
"spritePaletteIds": [],
"collisions": "",
"autoFadeSpeed": 1,
"symbol": "scene_1",
"x": 61,
"y": 58,
"script": [],
"playerHit1Script": [],
"playerHit2Script": [],
"playerHit3Script": []
}Notice the “backgroundId” key? If you want the background of this Scene to use the background listed above, we would simply need to insert the “id” value from that background into that key. The other important areas to note are the “x” and “y” keys, those are the scene’s location on the GB Studio canvas in the editor, and the “script” array. If you add any scripts to your scene, these will appear in this area.
Generating the Scenes with a Python Script
We can now build a “template” scene with the scripts we want, copy that into a python script as its output, then edit key areas as placeholders for variables. The scene name, index, x, y, and backgroundId can all be looked up from a CSV or generated accordingly. Here’s a sample of some of the python code I created to do that:

The text in blue are variables either set by reading a CSV or generated programmatically (like the X and Y values), but the creat_hash() function is important to note. Those hashes I mentioned before, if you reuse the same hash across different aspects of the project file, GB Studio will not be able to parse the project file correctly and things will break. To fix that, I created a function that randomly generates that hash. This is the code for that:
import random
def create_hash():
hexstring = ""
for x in range(16):
if x == 4 or x == 6 or x == 8 or x == 10:
hexstring += "-"
hexstring += f"{random.randint(0,255):02x}"
return hexstringThe nice thing about this approach, is if an entry gets removed, changed or updated, I can just re-run the script and everything is generated again.
Changing Scenes and Displaying Artist Info
The last piece of the puzzle is managing how scenes change and how the artist info is displayed. While this could have been coded into each scene, I felt a more programmatic approach was appropriate. Instead of having to consider what each scene’s before/after scene is, have one big switch with all the scenes, and assign an “ID” variable to each scene. This has a few advantages, but the biggest one being that you can also use it for the Scene Index when navigating the Gallery. Simply call the script with the scene ID variable, and it will determine which scene to load.
Attempting to do this manually is a slog. I did this for the first year. Since Switch Events in GB Studio have a maximum of 16 values, I created 140 [If Variable Compares to Value] events and manually set each one. For the 2024 gallery, I instead relied on python code to read the values in a CSV and then this time export a GBVM script that I could copy and paste into a GB Studio Event:

Python code that generates the Switch Statement.
GBVM in GB Studio allows for switch statements with up to 255 cases, so there was a bit of math at the front of the switch to account for going over with 343 scenes. The end result looked something like this:
.include "macro.i"
;Fade Out
VM_SET_CONST_INT8 _fade_frames_per_step, 1
VM_FADE_OUT 1
VM_IF_CONST .LTE, VAR_SCENE_ID, 255, 100$, 0
VM_JUMP 101$
100$:
;Scene Switch
VM_SWITCH VAR_SCENE_ID, 255, 0
.dw 1, 1001$
.dw 2, 1002$
.dw 3, 1003$
.dw 4, 1004$
.dw 5, 1005$
.dw 6, 1006$
.dw 7, 1007$
.dw 8, 1008$
.dw 9, 1009$
…
.dw 250, 1250$
.dw 251, 1251$
.dw 252, 1252$
.dw 253, 1253$
.dw 254, 1254$
.dw 255, 1255$
1001$:
VM_RAISE EXCEPTION_CHANGE_SCENE, 3
IMPORT_FAR_PTR_DATA _scene_1
1002$:
VM_RAISE EXCEPTION_CHANGE_SCENE, 3
IMPORT_FAR_PTR_DATA _scene_2
1003$:
VM_RAISE EXCEPTION_CHANGE_SCENE, 3
IMPORT_FAR_PTR_DATA _scene_3
1004$:
VM_RAISE EXCEPTION_CHANGE_SCENE, 3
IMPORT_FAR_PTR_DATA _scene_4It looks a little crazy, but again that’s all being managed by the python script, so I just hit run and it gets generated. I followed a similar approach for the Artist info. Read the CSV file and generate a GBVM Switch that will render the information on screen according to the ID:

Python to generate the Artist Info
And the resulting GBVM looks something like this:
VM_IF_CONST .LTE, VAR_SCENE_ID, 255, 100$, 0
VM_JUMP 101$
100$:
;Scene Switch
VM_SWITCH VAR_SCENE_ID, 255, 0
.dw 1, 1001$
.dw 2, 1002$
.dw 3, 1003$
.dw 4, 1004$
.dw 5, 1005$
.dw 6, 1006$
.dw 7, 1007$
.dw 8, 1008$
.dw 9, 1009$
…
.dw 252, 1252$
.dw 253, 1253$
.dw 254, 1254$
.dw 255, 1255$
1001$:
VM_LOAD_TEXT 0
.asciz "Artist:\012@lafontaine_dl"
VM_JUMP 10$
1002$:
VM_LOAD_TEXT 0
.asciz "Artist:\0123D"
VM_JUMP 10$
…
1341$:
VM_LOAD_TEXT 0
.asciz "Artist:\012Yoush"
VM_JUMP 10$
1342$:
VM_LOAD_TEXT 0
.asciz "Artist:\012Yusof Iranmanesh\012GreenCube"
VM_JUMP 10$
10$:
VM_OVERLAY_CLEAR 0, 0, 20, 5, .UI_COLOR_WHITE, ^/(.UI_AUTO_SCROLL | .UI_DRAW_FRAME)/
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_SPEED_INSTANT
VM_OVERLAY_MOVE_TO 0, 13, .OVERLAY_IN_SPEED
VM_OVERLAY_SET_SCROLL 1, 1, 18, 5, .UI_COLOR_WHITE
VM_DISPLAY_TEXT
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT | .UI_WAIT_BTN_A)/
VM_OVERLAY_MOVE_TO 0, 18, .OVERLAY_OUT_SPEED
VM_OVERLAY_WAIT .UI_MODAL, ^/(.UI_WAIT_WINDOW | .UI_WAIT_TEXT)/
What’s important here is the GBVM code at the bottom that closes out the dialogue box. Without it, it won’t work.
Putting it All Together
In the end, there was still a fair bit of manual work to get it all working, particularly with the indexing of artists, and I probably put as much time into coding all the generating tools as I would have done it manually, so it took a long time to get out. But now I have an awesome template to work from that should make it easier to generate the Galleries going forward and get that out to our participants sooner.
I’m also excited for the Gallery to have its first Physical Installation, premiering at Sheridan College with the show running until February 2026. Looking forward to what the future holds with this Pixel Art Jam!

Audio Engineer, Mac Technologist and Video Game Developer. Former Managing Editor of GBStudio Central. (he/him)
