If you take a look at the github source of the i2c-exp-driver, there is a subdirectory called bmp2lcd. In there is the javascript on how to create the image (looks like a simple packed binary stream).