L
Lorenzo J. Lucchini
Don said:I'm not saying that one should not use an external editor because the
driver-integrated tools are equivalent. They are obviously not, with any
dedicated editor having many more tools.
There you go! So why do you argue against it?
[snip]
Look, we're going around in circles and we'll never get out of this
discussion like this.
I'll try to take another approach, by laying down my point of view in as
formal a way as I can.
You're not really supposed to read carefully through all this, but if you
do, then at least you can now point *very* specifically to the parts you
don't agree with.
If you don't, at this point we can just agree to disagree agreeably, as you
said.
Note that
- an ASSUMPTION is something that was either true in the OP's case or that I
take as reasonable for the user of the scanner to do
- a FACT is something that I take as true if the ASSUMPTIONs are valid; I
suppose most of your disagreement ought to be about FACTs
- a PROBLEM may have a SOLUTION, that only makes sense if the FACTs are true
- a CONCLUSION states what, at the end of the day, can be reasonably
obtained by means of SOLUTIONs; we might disagree on CONCLUSIONs, even
though only empirical tests (or, at best, very rigorous mathematical
demonstrations) can really tell
Lastly, note that what's said here can be applied to setting the exposure
time (instead of setting the blackpoint and whitepoint, as in the OP's
case) as well.
The mere fact that people *do* use their "tiny preview keyholes" to set
their exposure times ought to suggest that it ain't so bad after all... but
I know *you* just go and take multiple exposures
(1) ASSUMPTION: We intend to scan at the scanner's native resolution.
(2) ASSUMPTION: We have a scanner that computes n bits for every sensor
cell, but only outputs m bits to the computer, with (m < n).
(3) ASSUMPTION: The least significant (n - m) bits can carry meaningful
signal over noise.
(4) ASSUMPTION: The scanner allows to perform a levels mapping on the
scanned image, and this levels mapping is performed on the n-bit data
SPECIFICS: the scanner allows to set two variables
blackpoint
whitepoint
Then, every pixel the scanner sends to the computer is calculated as
output_pixel(i) = (input_pixel(i)-blackpoint)/(whitepoint(i)-blackpoint)
where input_pixel(i) is the i-th value from the sensor, and output_pixel(i)
is the i-th value sent to the computer, before quantization to m bits.
(5) DEFINITION:
Let's call max_input the highest value among (input_pixel(i) for every i).
Let's call min_input the lowest value among (input_pixel(i) for every i).
Let's call max_output the highest value among (output_pixel(i) for every i).
Let's call min_output the lowest value among (output_pixel(i) for every i).
(6) FACT: if blackpoint=0 and whitepoint=2^n-1, then max_input=max_output
and min_input=min_output.
(7) FACT: if min_input>0 and max_input<2^n-1, the amount of information that
can be fitted into the m-bit quantized data can be maximized by setting
blackpoint:=min_input and whitepoint:=max_input (*)
(*) This way, it will always hold true that min_output=0 and
max_output=2^n-1, and the full range of values will be available for every
output_pixel(i)
(8) FACT: If it is true that (max_input-min_input)<2^(n-m)-1 (*) , then the
m-bit quantized output data will contain more information by setting
blackpoint:=min_input and whitepoint:=max_input
than by setting
blackpoint:=0 and whitepoint=2^n-1
(*) Above that, the additional (n-m) bits that the scanner has will have
been all mapped 1-to-1 to the m bits of the output)
(9) PROBLEM: min_input and max_input are not known in advance of scanning.
(10) ASSUMPTION: We are prepared to take more than one scan of the same
picture.
(11) SOLUTION: In order to solve (9), set
blackpoint:=0 and whitepoint=2^n-1
then take the first scan ("preview").
Because of (6), it will be true that
min_input=min_output and max_input=max_output
Thus it will now be possible to set
blackpoint:=min_input=min_output and whitepoint:=max_input=max_output
and take another scan ("final").
(12) DEFINITION: Let's call
min_input_preview=min_input for the "preview" scan
max_input_preview=max_input for the "preview" scan
min_input_final=min_input for the "final" scan
max_input_final=max_input for the "final" scan
(13) FACT: It is true that
|min_input_preview-min_input_scan| < epsilon
and
|max_input_preview-max_input_scan| < epsilon
where
epsilon,epsilon << 2^n
since epsilon will only depend on scanner noise and on scanner fluctuations
between the "preview" and the "final" scans.
(14) CONCLUSION: (11) is a valid solution to problem (9), as the error in
the measurement of min_input and max_input has the same order of magnitude
as the errors that will be in every pixel of the output image.
(15) ASSUMPTION: To save time, we intend to take the "preview" scan at less
than the scanner's native resolution.
(16) PROBLEM: Given (15), the error in the measurement of max_input and
min_input may become greater than the above epsilon, as some pixels that
will appear in the "final" scan are ignored in the "preview" scan
(17) ASSUMPTION: At the scanner's native resolution, the scanner and/or the
scanned medium have a point spread function that is non-zero at points
other than the origin (*).
(*) In other words, the scanner's optics and sensor, and/or the film
resolution characteristics (as well as the characteristics of camera, scene
etc.), cause some blur.
(18) FACT: At the scanner's native resolution, a pixel's value is not
independent from the value of neighboring pixels; instead, it may only
differ from them by an amount that is, at most, equal to the maximum
difference between two neighboring sampled points in the above point spread
function.
(19) DEFINITION: Let's call
resolution_final the scanner's optical resolution
resolution_preview the resolution we intend to take the "preview" at
d the maximum possible difference between
max_output_preview and max_output_final (or between
min_output_preview and min_output_final)
(20) FACT: At a resolution of resolution_preview, d is equal to or less than
the maximum value of
|psf(0,0)-psf(i,j)|
for every
(i,j < resolution_final/resolution_preview)
where psf(x,y) is the point spread function discussed in (17) and (18).
(21) SOLUTION: In order to solve (16), take the "preview" scan as in (11).
Then set
blackpoint:=min_output_preview-d
and
whitepoint:=max_output_preview+d
(without letting blackpoint get smaller than 0, or letting whitepoint get
bigger than 2^n-1).
Now take the "final" scan.
(22) CONCLUSION: Solution (21) does not guarantee that min_output_final=0
and max_output_final=2^n-1, as solution (11) does. On the other hand, it
guarantees that no clipping will occur in the "final" scan (except clipping
of high-noise pixels), and thus that the "final" scan will contain at least
as much information as a scan taken with settings
blackpoint:=0 and whitepoint:=n^2-1
Thus, solution (20) is satisfactory, even though solution (11) is
preferable.
(23) PROBLEM: d is not known; even if we know the value d'>=d that can, in
theory, be estimated from the PSF, d' may be greater than the actual upper
limit on the difference between input and output values (*) .
(*) That's because of considerations I've thought of but not written in this
article, which would need some more attention and mathematical knowledge
than I have.
(24) SOLUTION: in order to solve (23), d can be estimated empirically from
test scans, and/or incrementally raised every time it's found to be too low
(i.e. the resulting image clips).
(25) PROBLEM: At this point, some of the "final" scans for which d was
underestimated may clip.
(26) SOLUTION: In order to solve (25), throw away the clipping images, and
scan then again using later, better estimate of d.
(27) CONCLUSION: Especially when a large number of pictures with similar
characteristics (e.g. pictures from the same roll of film and camera) are
going to be scanned (using the same scanner), solution (24) can be a good
approximation of solution (22).
With some heuristic refinements in order to keep the estimated value of d
just high enough to not result in clipping for the majority of the scans,
solution (24) could even approximate solution (11), at the expense of
failures (clipping) with a minority of the scans that will have to be
treated separately as in (26), i.e. re-scanned.
by LjL
(e-mail address removed)
Copyright 2005 Lorenzo J. Lucchini
(reproduction allowed if this copyright notice is left intact)