RFB Image Format

While continuing on the MicroVNC project, I had the idea to apply the VNC encodings to a static image instead of a stream of images.  I did some quick tests and the idea seemed promising.  After doing some more thorough testing I made a poster of the results, which I showed at the Open Hardware Summit, September 6, 2013 at MIT.

Abstract

Common image storage formats used by personal computers require a large memory overhead for decompression and cannot be used on small microcontrollers, leaving bulky uncompressed bitmaps as the default choice. VNC (Virtual Network Computing), commonly used for screen sharing between two PCs, uses the RFB (Remote Frame Buffer) protocol with some simple image encodings that can be decoded on small microcontrollers.

In this poster I explore the effectiveness of the RFB protocol’s Hextile encoding in reducing the file size of several types of images, and measure the overhead of adding decoding capabilities to a small microcontroller.

Poster

(Click to download PDF)

(Click to download PDF)

Source Code

Here's the source code for the programs I used to do the tests described in the poster. The code is rather rough, just good enough for a proof of concept and to get the data for the test.

RFBImageTool is used to encode the images. It looks for an input.bmp file, and writes to output.rfb, with some console output to show the size of the files, and the amount of data saved. To choose the encoding type (1-bit, 8-bit, 16-bit), toggle the comment blocks in main.c and recompile.

RFBImageTool depends on a modified LibVNCServer library to be installed, along with ImageMagick. Compile and install LibVNCServer using Autotools.

I was able to compile on OSX Lion. I have not tested compatibility with other platforms.

RFBDecoder requires the binary data in the RFB image to be converted to an array called "rawData", stored in the image.h header file. I used commercial Windows software Hex Workshop to do the conversion, though RFBImageTool should be extended in the future to write a header file directly. The image is compiled into the binary, so no external memory is needed to do the tests.

Here are the images used for testing: RFBTestBitmaps

The OSH logo is from oshwlogo.com

The tiger image is from Wikipedia