It's been longer than I wanted without an update, as I've been a little busy, so let me show you why.
Last month the first stable version of the free and open source GIMP 3 image editor was released. As it happens, I wrote a plug-in for GIMP a while ago, called Image2GB, which allowed me to export an image to the format used by the Game Boy C SDK, GBDK (which is currently maintained by the community as GBDK-2020). This was 5 years ago and while I've updated it a few times, it was still a GIMP 2-only project. So a couple of weeks ago I mustered my courage to begin the task of porting it to the new version of the software.
I thought it would be a piece of cake, two or three days worth of coding. It was not, and I only finished it yesterday, after cursing the GIMP development team several times because of the breaking API changes.
But hey, it's done now! And I dropped a few improvements here and there taking advantage of the opportunity. You may find the latest release and usage instructions in the link above.
Just to show you a quick example of how it works, let's choose a seemingly random image from the web:
Now, we load it in GIMP and convert it using my GB 4-color palette:
We export it using my plug-in's GUI menu:
And load it up in a sample Game Boy ROM, compiled using GBDK-2020. Very few lines of code required!
Here you can see the contents of the video RAM (with the 8x8 pixels tiles that GB graphics are made of), courtesy of BGB emulator:
If you're curious, here are the generated source code files, with and without support for banking (a technique that allows to build ROMs bigger than the default 32 kB):
If you don't have a GBDK sample readily available to test them, you can use this one (compiling's up to you):