gbcam2png: Game Boy Camera save RAM photo to PNG

Introduction

The Game Boy Camera is a Game Boy peripheral for taking low resolution (128 x 112, i.e. 14 kilo pixels) pictures in black and white (4 grey levels / 2 bit per pixel). The 128K battery-backed RAM built into the cartridge can hold a maximum of 30 photos.

There are a few ways (here's mine) to read the content of the cartridge RAM and store it in a file.

Photos contained in the save file can be extracted using special software. I found one named GBCameraDump, for Windows. It works fine in Wine, so even on other OSes it can be used to convert the photos to bitmap (.bmp) files.

Even though the above tool already existed, I decided to make my own. I began by doing a command-line tool for Linux outputting .png files.

Then, somewhat inspired by a Javascript N64 controller pak (memory pak) editor I knew of, and wanting to play with HTML5 Canvases, I made yet another tool, this time using Javascript/HTML5!

Here are a few pictures I recently took. The color theme matches what you get when the camera is used on a Game Boy Player (on a Gamecube).




Javascript/html5 tool

The Javascript/HTML5 runs in a web browser (locally) and will read from a file you select on your hard drive.

Features:
  • Displays the "large" (128x112) photos.
  • Also shows deleted photos.
  • Customizable color theme (using hex color codes) for the 4 "grey" levels.
  • 3 built-in color themes: Black and White, Gameboy and Gameboy player.
  • Export to .PNG using the "Save as..." browser features from the right-click on image menu.
Here are examples pictures using the built-in themes:
Black and White

Black and White

Game boy

Game boy

Game boy player

Game boy player





The tool is available here: gbcamtool.html


Command-line tool

The command-line version is more powerful than the Javascript version, however you will need to compile it to use it. (for now)

Features:
  • Extract "large" photos (128x112) to .PNG
  • Extract "small" (thumbnail) photos to PNG
  • Extract the "Game Faces" photo to a .PNG
  • Recover deleted photos
  • Single photo or batch (all photos) extraction
  • List photos

Use

Displaying help with -h

  Options:
    -h              Display this help text
    -i index        Source image index (first image is 0). Default: 0
    -g              Use gameface as source photo
    -o output.png   Export a single photo to a .png file
    -b basename     Export all photos to png files, using the specified basename
    -d              Display selected photo (see -i) to the terminal
    -l              List photos in save file
    -a              Also export deleted photos
    -s              Export/display small photos (32x32) intead of large photos (128x112)
    -v              Be verbose

Listing photos (shows which one are active and deleted)

./gbcam2png source.sav -l

Exporting a single photo (index 0) to a .png file

./gbcam2png source.sav -i 0 -o output.png

Exporting all active photos

./gbcam2png source.sav -b test
Pour chaque photo active (c'est à dire, qui n'a pas été effacée) un fichier nommé testXX.png (où XX correspondra à l'index de la photo, compté depuis 00) sera créé.

Exporting all photos, including deleted ones

./gbcam2png source.sav -b test -a

Displaying a photo in a terminal (-d)

Since the resolution is quite low, displaying a photo by controling the terminal background color (using ANSI/VT100 codes) is possible. A very small font must be used however, and the aspect ratio is off...
./gbcam2png source.sav -i 15 -d



This project is also available on GitHub!
To request features, report issues or contribute, you may send me an email or use the GitHub repository:
https://github.com/raphnet/gbcam2png



My technique to read RAM

The N64 to USB adapter I desgined, combined with its PC-side management software, supports the N64 Transfer Pak. The Transfer Pak makes it possible to read/write from/to a Game boy cartridge, ROM or RAM, and the management software can do so for several types of Game boy cartridges.

Since version 2.1.14, the management software is also able to read and write the Game Boy Camera RAM.

So to transfer photos to my PC, I use the following:
raphnet-tech N64 to USB adapter V3

raphnet-tech N64 to USB adapter V3

N64 controller

N64 controller

Transfer Pak

Transfer Pak

Game boy camera

Game boy camera



Here are all the above items in action:
USB adapter, Controller, Transfer Pak and Camera

USB adapter, Controller, Transfer Pak and Camera



Backing up the cartridge RAM is a simple matter of accessing the Transfer Pak -> Read cartridge RAM to file... menu and entering a suitable file name.



Reading the RAM completely takes less than 1 minute. Then you use the tool of your choice to view and extract the photos.


A quick overview of other approaches

There are other ways to retrive pictures from a Game boy camera. Here are a few: Note: One advantage of using the printer (real or emulated) is that photo frames will be present.