[sane-devel] XSane/Epson problems and comments

Juhana Sadeharju kouhia@nic.funet.fi
Mon, 21 Oct 2002 10:42:39 +0300


Hello. Some Xsane/Sane-Epson notes:

Summary: I want save the scanned image "as is" without effects
and without value range clippings at bottom or top. The design
of sane/xsane seems to make this difficult to optain. I need
help in finding suitable settings.

I would like to have all Epson developers documentations?
Where I may download them?

I suggest to read the rest of the mail paragraph by paragraph.

 -*-

There should have "unsharp off" switch. Sharpness = 0 or = "normal"
tells nothing. Elsewhere "normal" may mean "unsharp masking on"!!
What sharpness = 0 or = "normal" means in Sane? Is it "off"?

Gamma option could be named better. It took me a while to understand
that "default" means gamma on and that "brightness" controls the
gamma curve. Does "user defined" mean gamma = 1.0, and that
any gamma then can be added at enchangement phase? I.e., the
raw image has no gamma applied. Where the user defined gamma curve is
defined? xscanimage provides the gamma curves but xsane does not.

With or without gamma, I have got only two cases:
1. xsane histogram clips the top values,
   gimp histogram clips the top values of the filed image
2. xsane histogram does not clip the top values,
   gimp histogram clips the top values of the filed image
That is, as case 2. indicates, there is also something wrong in
the save operation. Check screenshot of gimp and xsane histograms
at "http://www.funet.fi/~kouhia/histograms.pnm". It shows the
case 2.

Check screenshot of MS Win driver histogram at
"http://www.funet.fi/~kouhia/winhisto.pnm", and compare it to
above histogram image. When scanning images, no clipping
should occur; values should fit in range 0-255 (or 0-65535) with
some quard space at bottom and top. "winhisto.pnm" shows a good fit.

However, could it be that MS Windows driver soft-limit the values
to below the value 245 (or such; see the "winhisto.pnm")? I.e.,
the gamma curve bends slowly to the value g[255] = 245.

I found following in a saved image:
  XSane settings:
   resolution_x =  200.0
   resolution_y =  200.0
   gamma      IRGB = 0.00 8.66 0.00 8.31
   brightness IRGB =  8.3  8.3  8.3  8.8
   contrast   IRGB =  0.0  8.3  0.0  8.2
Those gamma etc. values looks rather odd. Why I and G are 0.0?
What represents the values 8.66 and 8.31? Who set them? I used
gamma 1.0, brightness 0.0, and contrast 0.0. "user defined" and
no color correction in epson options.

Xsane code reveals that the gamma correction is always performed.
How do I set that the scanner is not doing the correction
and that xsane is not doing the correction? If the gamma = 1.0,
is the gamma table really of the form g[0] = 0, g[1] = 1, ...,
g[255] = 255 --- that is, no rounding errors whatsoever.

When gamma is not in use, there should be "exposure" control
for the scanner. Why there is no such control? MS Windows driver
seems to have such a control. I forced "F5" epson type/level,
but no exposure control appeared in Xsane GUI (only the bay
control appeared additionally).

Can exposure adjusted from a hardware knob or such? If nothing
else helps to the overexposure (clipping), that is.

Histogram seems to not work properly; I changed the brightness of
the epson options but while the image changed, it had no effect to
the histogram. Could be separate bug.

 -*-

The xsane/sane-epson application is quite confusing. How about
clearly separating (1) the operations done inside the scanner
and (2) operations done in sane-epson driver, and (3) operations
done in xsane? For example, gamma/color curves would be set separately
for the scanner and for the driver, and for the frontend application.
(Frontend application could warn if user has set gamma curves
in multiple places.) In any case, now it is quite difficult to
understand, say, are gammas curves applied or not; are they applied
for the display only or not. This triple module system would not
be any more difficult to understand, but would help in understanding
what various effects are --- at least, I suspect that some patented
effect in the scanner is better than equivalent effect in
an open source application. The triple module system would separate
these different brands of algorithms clearly.

A menu entry "save the raw image" would help in making sure xsane
does not save the enchanged image. It is now too easy to save image
calibrated for CRT screen with gamma and other effects applied.

It is surprise that people want to immediately process the image
for screen or printing whatever. These processings cannot be undone.
If the raw image is archived, images could later be processed for
different screen and different printers. There seems to not have
an image viewer which can do the screen gamma correction and other
display effects on-the-fly so that users could convenietly work
with archived raw images. For example, sharpen effect helps greatly
in reading textual images, but never I would want archive pre-sharpened
images.

Here is a diagram of the ideal system for me:

  --------------------    -------------------
  | scanner without  |    | backend without |---> "save raw image"
  | effects but with |--->| effects and     |---> xsane enchangements
  | optimal exposure |    | processings     |---> print tool
  --------------------    -------------------

and

  ---------
  | raw   |-------> image viewer with effects
  | image |
  | file  |-------> print application
  ---------

(Note: "raw" image in above does not mean a raw image format; it means
the raw image loaded from the scanner.)

The optimal exposure would mean that all intensity values fits to the
range 0-255 (0-65535) and that the values are as close as possible to
the values read from A/D converter (whatever).

Best regards,

Juhana