cmttoppm: CMT to PPM Converter
Based on my analysis of CCD used in ES-1000,
I have made a converter from CMT (internal image format of ES-1000) to
PPM (an image format common on Unix). It is tested only on Linux, but
as all it does is to read/write files it should be easy to let it run
on other OSs.
Besides CMT, it can also convert IMG files which is the standard file
format of LXDC.
C source of cmttoppm is here. It can be compiled
Currently the only document for cmttoppm is this page; please save
this page to a local file. I am going to write a manual later.
gcc -O2 -lm cmttoppm.c -o cmttoppm
Summary of cmttoppm
Following command line converts a CMT file to PPM file:
cmttoppm [options] [CMT_file [PPM_file]]
- If a CMT file or a PPM file is not specified, standard input and
output will be used instead.
- An IMG file of LXDC can be specified instead of a CMT file
(formats will be identified automatically using file header).
- -s (default: 1.5)
- Correction parameter of saturation (make this bigger for louder colours)
- -G (default: 0.5)
- Gamma parameter (make this smaller to assign more contrast to dim areas)
- -r, -g, -b (default: 0.64, 0.58, 1.00 accordingly)
- Correction parameters of red, green, and blue (make each colour stronger)
- -n (default: 3)
- Percentage of pixels to ignore at lower and upper bound
(make this bigger for higher contrast)
- Specifies lower bound explicitly
- Specifies upper bound explicitly
PPM files generated with cmttoppm can be used on many image
manipulation programs on Unix such as Imagemagick, Netpbm, or xv.
cmttoppm does not change aspect ratio as images are usually magnified
or reduced anyhow before being used; please enlarge images vertically
by 156% using some image tool.
Adding some sharpness to the picture is a good idea to make it look better.
For example, convert command of
Imagemagick can used with following options to produce an output
similar to Chinon driver:
convert -geometry 100%x156% -sharpen 80 src.ppm dest.ppm
- Pictures taken against sun looks sometimes greenish.
You can get around this phenomenon by executing cmttoppm again with a
smaller value to -h option; 2/3 of the default value can be suggested.
Default -h value is shown as "high_i = ".
- Does not support 320x240 pixels mode.
This CMT file is converted by
cmttoppm and Chinon driver to following outputs. They look similar
enough to my untrained eyes.
Several pixels on the top/bottom/left/right borders of CCD of ES-1000
have incorrect colours. As opposed to Chinon driver which cut these
pixels off, cmttoppm keeps them with their incorrect colour. This
makes output of cmttoppm to 500x375 pixels instead of 493x373 of
Command line to generate it:
cmttoppm 960812-2.cmt 960812-2.ppm
convert -quality 85 -sharpen 80 -geometry 100%x156% 960812-2.ppm 960812-2-hideki.jpg
Command line to generate it:
(Read 960812-2.cmt on Windows driver and store it to 960812-2.tif)
convert -quality 85 960812-2.tif 960812-2-chinon.jpg
Please send questions and comments about this page to