SNIP
Bart, you need to install the ImageMagick Windows
runtimes (
www.imagemagick.net), I said that in the NG
message and in the README; if the ImageMagick
installation works, it should find the DLLs automatically,
wherever they are.
Yes, I already re-installed the DLL version of the pre-compiled
ImageMagick, and at installation time I ticked the box to include
C/C++ support. Your program is now running without error messages.
But please take your time! I certainly don't want you to
wast time on that!
No problem.
My first DFS v0.1 run was on the Scanner Bake-off 2005 slide (Velvia),
on a Windows XP Pro SP2 platform.
I started the scanner, and used only VueScan (8.1.38) to calibrate,
then insert the slide holder, and re-calibrated again. With the Crop
area set to maximum, I did a prescan and made sure the highlights
weren't clipped too much. I also color balanced and set the black
point for later, but that shouldn't influence the Raw data. I locked
exposure, previewed and locked image color. I then scanned the image,
which took a while (no surprise at 5232x7800 pixels x 4 16-bit
channels), and saved as 64-bit TIFF. I then moved one frame (to my
dark frame slide), and scanned again with the same locked settings.
The second (Dark) frame has the following Photoshop statistics (I left
out the left most first column, which is all white, for the
statistics):
Red: mean=0.60, stddev=0.49, median=1, highest bin=3 (14 pixels)
Green: mean=0.50, stddev=0.50, median=0, highest bin=3 (4 pixels)
Blue: mean=0.87, stddev=0.36, median=1, highest bin=3 (148 pixels)
So I have basically 1-bit out of 16 dark noise.
There were no noticeable lines at gamma 1 or after gamma 2.2
adjustment (on an 8-bit/channel CRT), unless levels were applied. The
slide scan itself revealed 1 darker line I could find in a dark
shadow, but on earlier scans I have also seen, say, 3 lighter lines.
Either my scanner is less sensitive to the issue, which I find hard to
believe because I have seen the faint lines before in other scans, or
Ed Hamrick recently did improve the calibration ...
Anyway, I couldn't find the 1 darker line anymore after running your
DFS, and the noise was a bit more visible but that was to be expected
after DFS. I'll have to run a few more tests at different levels of
scanner heat up, and perhaps with older versions of VueScan, but I
experienced no real issues with your DFS utillity.
The C code looks well written and commented, and seems easy to follow
as I read it superficially. It ran with little impact (<10%) on the
processor cycles, but did slow down system response (high priority
process), maybe due to Hard Drive activity.
Now, since I also did some C programming several moons ago, allow me
to make a few small programming/flow suggestions (I loved the profiler
for code optimization).
Obviously, when you've figured out how to read the relevant tags from
the TIFF header (I know you were in a hurry for version 0.1), there
should be no need to specify the number of channels for the source
file and the dark file on the command line.
Next, your program first reads the source file, then the dark file,
and then calculates the dark average. Although I didn't have any
problems with my two 311 MB files in a limited amount of available
memory, I'd prefer reading the dark file first, calculate the average,
and release the dark frame's memory leaving the average, and then read
the Source file. That will reduce the memory requirements to almost
half. The sequence on the command line is still logical, but you don't
have to execute in the same order.
I'll study the Averaging function a bit further to see if I can
suggest improvements. On an earlier investigation, I also discovered a
small regular ripple in dark areas, which indicates that the columns
aren't constant but fluctuate with a small amplitude sinusoid around
an average.
So far my initial impressions, kudos for a fast hack well done.
Bart