Here are my two tools for working with raw images downloaded from the
JamCam using "gphoto2 --get-all-raw-data".  Remember that gphoto2
might need patching to avoid an effect of regular 'bad pixels' if you
have a later model JamCam -- see my page:

  http://uazu.net/rejam/


'jc_pack_raw' can be used to take a raw JamCam image, and split it
into its four quadrants (GRBG) before saving it as a single .png file.
The point of this is that a PNG file compresses a lot smaller than the
raw file (or even a gzipped raw file), which is handy if you want to
keep the raw images for later.  It is optional to use this, though.

'jc_expand' takes either a .raw file or the .png file generated by
jc_pack_raw and interpolates the colours and applies gamma correction.
The result may be output as a PNG, JPG or PNM file (selected with the
file extension).  The colour interpolation is better than that done by
gphoto2 2.1.0, and the gamma correction is applied after converting to
HSV which gives much better colours.  A good gamma value was found to
be 2.5, and this is the default.  Doing gamma correction at this point
rather than in later tools also minimises loss of accuracy.

The above tools both use the pnm tools to handle PNG and JPG formats,
specifically: pngtopnm, pnmtopng and pnmtojpeg.

-- Jim
