Leica no longer replaces the CCD sensor used in the Leica M9 series and M Monochrom.
Third Party repair shops will replace the cover glass used for these cameras.
The CCD array in the M9P, M Monochrom, and (likely) M-E use a cement that is different
from the original M9. At this point, only one repair facility will replace the cover
glass on these cameras.
This repair can introduce problems with the calibration of the left vs right side
of the sensor array. The KAF-18500 uses separate calibrations for the two halves
of the array. The process of replacing the cover glass can affect the calibration.
This problem manifests itself in the image as one side being darker than the other.
Two programs are provided here to correct this problem:
1) M9CAL: generate coefficients to align the left half of the image with the right
2) M9FIX: use the coefficients to correct the error.
The programs work only with uncompressed DNG files as produced by the camera.
The file sizes are:
M9: 36,433,920 Bytes
MM: 36,433,408 Bytes
The program works with the Image File as saved by the camera, Photoshop and other
programs change this original file when saving it. Lightroom does not change the file.
M9CAL:
This program is used to generate the calibration coefficients. The Serial Number of the
camera is detected in the DNG file and used to name the calibration once is it generated.
M9CAL will also make the "C:\M9CAL" directory when it is run. M9CAL will store calibration
files in this directory.
The user must make a set of 5 images to perform the calibration. It is recommended to
use an 18% grey card for this, but any uniform image will work.
Five files are required to produce the calibration:
M2.DNG: -2ev Exposure
M1.DNG: -1ev Exposure
P0.DNG: correct Exposure
P1.DNG: +1ev Exposure
P2.DNG: +2ev Exposure
M9CAL reads these files in, performs an 8x8 average over the image, and selects the
center values on each side of the KAF-18500 to generate a linear fit. This is a simple
Y= X* Slope+ Intercept calculation. A Least Squares Fit routine is used. Use the CMD prompt
to change to the directory that these 5 files are stored, run the program.
Assuming M9CAL is stored in directory "C:\M9CAL", type
C:\M9CAL\M9CAL
to run the program.
You will get messages to the screen as the files are parsed and processed.
Program M9FIX is used to apply the calibration to the DNG files from the camera.
The program uses a minimum of input, asks for a Filename. The user may input a specific
file to apply the correction. Hitting "enter" without giving a filename results in M9FIX
spawning a "DIR L???????.DNG" command to get all files in the directory. M9FIX then
runs the correction for all DNG files as named by the camera. The Serial Number from the
DNG file is used to select the correct calibration generated previously and stored in
"C:\M9CAL". Files from the M9 and M Monochrom may be in the same directory, M9FIX uses
metadata stored in the DNG file to determine camera type and serial number.
The "Command Line Prompt" is invoked by typing "cmd" on the "type here to search" on the
Windows task bar. An old style "DOS Window" will open on the screen. M9CAL and M9FIX are
"Character Mode Executable" programs. One easy way to use them is to create the "M9CAL"
directory and store the .exe files there.
After typing "cmd", create the directory using:
MD C:\M9CAL
Now you want to download the two .EXE files to it.
M9CAL may be downloaded from this link (link updated 9/2024):
www.dropbox.com
M9FIX may be downloaded from this link (link updated 9/2024):
www.dropbox.com
Fortran-77 Source code for the Watcom Fortran V2 compiler is available:
Dropbox
Dropbox
The M9FIX code does not change the original file from the camera. Instead,
it creates a new version of the DNG file with a "C" as the first character
in the name. SO- if your original file is "L1000001.DNG" the new file will be
"C1000001.DNG". If your SD card is less than 1/2 full, this means you can run
the M9FIX program on the card. Insert it into the computer, find the Device Letter.
On my computer the SD card usually comes up as "I:". The DNG files are stored under
"DCIM\LEICA101" or something close to that. Use Windows Explorer to find the DNG files.
At the CMD prompt, change to the SD card and the correct directory using (for example),
I:
CD I:\DCIM\LEICA101
do a "DIR" to see your files.
Assuming the M9FIX program is in directory C:\M9CAL type in
C:\M9CAL\M9FIX
you will get a prompt,
FILE TO PROCESS:
Just hit enter without giving a name to process all files in the
directory.
You will see lots of messages coming to the screen. The coefficients,
serial number of the camera, and information found in the DNG file
that are written to the screen as M9FIX parses the file looking for
the image.
At the end, you should have new DNG files that start with a "C".
These open in Lightroom and Photoshop, I have not tested on others.
The DNG file header has not been altered, only the image data for the left
side of the sensor has been altered.
All software is "free and as is". I'm not putting that licensing stuff in it. Source code provided- so anyone can download the Watcom Fortran-77 V2 compiler and build it. No special setup required, it will complain that I declare some variables and so not use them. I started with code written long, long ago in a DOS galaxy that is Far, Far away from most people. But not for me.
This was about 20 hours of work- if anyone else wants to put a GUI, write their own from scratch looking at this code, or port to a MAC- feel free.
And I like upper case. Using Mixed-Case slows me down from writing code.
EDIT: One camera required calibration coefficients to be generated for ISO 160, 640, 1250, and 2500. The imbalance is a huge 10% on this camera at ISO 160 and about 8% at ISO2500. I ended pulling the ISO speed from the DNG file and using it to select the coefficients. I've not modified the M9CAL program to do this automatically.
Third Party repair shops will replace the cover glass used for these cameras.
The CCD array in the M9P, M Monochrom, and (likely) M-E use a cement that is different
from the original M9. At this point, only one repair facility will replace the cover
glass on these cameras.
This repair can introduce problems with the calibration of the left vs right side
of the sensor array. The KAF-18500 uses separate calibrations for the two halves
of the array. The process of replacing the cover glass can affect the calibration.
This problem manifests itself in the image as one side being darker than the other.
Two programs are provided here to correct this problem:
1) M9CAL: generate coefficients to align the left half of the image with the right
2) M9FIX: use the coefficients to correct the error.
The programs work only with uncompressed DNG files as produced by the camera.
The file sizes are:
M9: 36,433,920 Bytes
MM: 36,433,408 Bytes
The program works with the Image File as saved by the camera, Photoshop and other
programs change this original file when saving it. Lightroom does not change the file.
M9CAL:
This program is used to generate the calibration coefficients. The Serial Number of the
camera is detected in the DNG file and used to name the calibration once is it generated.
M9CAL will also make the "C:\M9CAL" directory when it is run. M9CAL will store calibration
files in this directory.
The user must make a set of 5 images to perform the calibration. It is recommended to
use an 18% grey card for this, but any uniform image will work.
Five files are required to produce the calibration:
M2.DNG: -2ev Exposure
M1.DNG: -1ev Exposure
P0.DNG: correct Exposure
P1.DNG: +1ev Exposure
P2.DNG: +2ev Exposure
M9CAL reads these files in, performs an 8x8 average over the image, and selects the
center values on each side of the KAF-18500 to generate a linear fit. This is a simple
Y= X* Slope+ Intercept calculation. A Least Squares Fit routine is used. Use the CMD prompt
to change to the directory that these 5 files are stored, run the program.
Assuming M9CAL is stored in directory "C:\M9CAL", type
C:\M9CAL\M9CAL
to run the program.
You will get messages to the screen as the files are parsed and processed.
Program M9FIX is used to apply the calibration to the DNG files from the camera.
The program uses a minimum of input, asks for a Filename. The user may input a specific
file to apply the correction. Hitting "enter" without giving a filename results in M9FIX
spawning a "DIR L???????.DNG" command to get all files in the directory. M9FIX then
runs the correction for all DNG files as named by the camera. The Serial Number from the
DNG file is used to select the correct calibration generated previously and stored in
"C:\M9CAL". Files from the M9 and M Monochrom may be in the same directory, M9FIX uses
metadata stored in the DNG file to determine camera type and serial number.
The "Command Line Prompt" is invoked by typing "cmd" on the "type here to search" on the
Windows task bar. An old style "DOS Window" will open on the screen. M9CAL and M9FIX are
"Character Mode Executable" programs. One easy way to use them is to create the "M9CAL"
directory and store the .exe files there.
After typing "cmd", create the directory using:
MD C:\M9CAL
Now you want to download the two .EXE files to it.
M9CAL may be downloaded from this link (link updated 9/2024):
Dropbox
M9FIX may be downloaded from this link (link updated 9/2024):
Dropbox
Fortran-77 Source code for the Watcom Fortran V2 compiler is available:
Dropbox
Dropbox
The M9FIX code does not change the original file from the camera. Instead,
it creates a new version of the DNG file with a "C" as the first character
in the name. SO- if your original file is "L1000001.DNG" the new file will be
"C1000001.DNG". If your SD card is less than 1/2 full, this means you can run
the M9FIX program on the card. Insert it into the computer, find the Device Letter.
On my computer the SD card usually comes up as "I:". The DNG files are stored under
"DCIM\LEICA101" or something close to that. Use Windows Explorer to find the DNG files.
At the CMD prompt, change to the SD card and the correct directory using (for example),
I:
CD I:\DCIM\LEICA101
do a "DIR" to see your files.
Assuming the M9FIX program is in directory C:\M9CAL type in
C:\M9CAL\M9FIX
you will get a prompt,
FILE TO PROCESS:
Just hit enter without giving a name to process all files in the
directory.
You will see lots of messages coming to the screen. The coefficients,
serial number of the camera, and information found in the DNG file
that are written to the screen as M9FIX parses the file looking for
the image.
At the end, you should have new DNG files that start with a "C".
These open in Lightroom and Photoshop, I have not tested on others.
The DNG file header has not been altered, only the image data for the left
side of the sensor has been altered.
All software is "free and as is". I'm not putting that licensing stuff in it. Source code provided- so anyone can download the Watcom Fortran-77 V2 compiler and build it. No special setup required, it will complain that I declare some variables and so not use them. I started with code written long, long ago in a DOS galaxy that is Far, Far away from most people. But not for me.
This was about 20 hours of work- if anyone else wants to put a GUI, write their own from scratch looking at this code, or port to a MAC- feel free.
And I like upper case. Using Mixed-Case slows me down from writing code.
EDIT: One camera required calibration coefficients to be generated for ISO 160, 640, 1250, and 2500. The imbalance is a huge 10% on this camera at ISO 160 and about 8% at ISO2500. I ended pulling the ISO speed from the DNG file and using it to select the coefficients. I've not modified the M9CAL program to do this automatically.
Last edited: