Array to image using ESP8266 Webserver

Hi All,

Anyone know how I can create/load an image into the ESP8266 webserver from an array?

Or this would also be applicable - How to converter a given array to a .bmp file (so that it can be loaded through conventional means).

It can be done, but it is not easy. You have to understand the internal format of .bmp files, which is one of the more simple image formats, but still quite complex. I don't know of an easy-to-use library for this purpose.

My question for you is... why do you want to do this, or think you do? Please explain what what is in this array and how it got there and how you want it to appear to a user viewing the web page. There may be other, better or easier ways to achieve the same thing.

I want a way to print out data that is sent to an LCD display, either for my website tutorials or where I can’t physically see a display attached to a ESP8266 and want to have a web copy.

I’m already plotting data to an array, now just need to use this to conveniently save on an SD card or display on a web browser. See attached.

Still very confusing! I'll take a guess.

The ESP is somehow gathering information from sensors on the status of a battery. It is then rendering the data into a bitmap. The bitmap is then sent to a graphic LCD. The above picture is the bitmap rendered as "*" and " " representing lit and unlit pixels and printed to serial monitor?

So you now want to have the ESP act as a web server, and allow the bitmap to be viewed as a .bmp file embedded in the web page?

For me, the obvious question is: why not put the original sensor values directly on the web page? It would be much more straight forward, much nicer and clearer looking, and the web page would be quicker to load/refresh, as no .bmp file needs to be created and served by the esp.

Alternatively, do what you are doing now with the serial monitor, but send the "*"/" " rendered image as part of the web page. If you specify a fixed-width font like Courier, it should look just the same.

PaulRB:
Still very confusing! I'll take a guess.

The ESP is [...] rendering the data into a bitmap.

Its rendering data to an 'x;y' array, which I want to convert to a .bmp

PaulRB:
For me, the obvious question is: why not put the original sensor values directly on the web page?

The whole aim is to save a .bmp of whatever is being printed.