Any suggestions for a way to view a bitmap image generated by a model?

I have an imp device in a robot that has pseudo 3D sonar range data (approx 120deg horizontal view out to 5m) and I need to visualize this in the form of a bitmap representation similar to a Kinect depth map. I know, for example, that I could get my agent code to format a binary blob as a .BMP file but I can’t think how to access that from a browser. It would be a fairly low-res image (without any interpolation maybe just 120 pixels square) and only refresh once every 5 seconds. Or are there any better ways to achieve such a visualization?

Just thought to jump in and comment. Usually it’s a case of doing this is in iterative steps starting by converting the bitmap image into a byte array and then encoding using Base64 format to POST before decoding and then showing image on the webpage for visualisation etc.

Imp has some base64 encoding and decoding methods which may help here. According to imp documentation you can use the Base64 method to encode binary data too so may not need the converting to byte array step. I’m sure other experts in the community will be able to advise.

You can just make a BMP and set the content-type appropriately in the reply - you can just push binary down there, there’s actually no need to base64 it these days.

But… the simplest way for such a low-res image might just be ASCII art?

OK, thanks for the tips. I’ve now got it working by FTP’ing the .BMP image to my server and using freeboard to display it along with other instrumentation. ASCII art is a great idea but now I’ve got raw data going to the agent I’m able to “fancy it up” into a full-colour image :slight_smile: