Is there an easy way to turn integer values to pixels? I'm working with a black &amp; white camera and it gives me integer values to represent the amount of light hitting the sensor. Very bright is 1023 and totally dark is 0. The values are printed through serial and everything works fine but now I want to recreate the image based on the values.

Does anyone know if there is a simple way of doing this? I'm assuming the process would consist of looking up the value and giving a specific colored pixel in return, but I have no idea how to do this.
Simplest thing may be to write down your image in plain Portable Gray
Map format. This is a very
simple (and inefficient) ASCII format consisting of a signature (the
string "P2"), followed by the width and height of the image, followed by
the maximum possible gray level (1023 in your case), followed by the
pixel values. It's a free form format, meaning you can mix spaces and
newlines at your convenience.

Here is an example image: two rows of pixels, five columns, and
brightness increasing left to right and top to bottom:

P2
5 2
1023
  0 111 222 333 444
555 666 777 888 999


Then, any image conversion software should be able to convert that into
the format of your choice (PNG, JPEG, whatever...).