Hi Olaf,
On 10/15/20 11:59 AM, Olaf Meeuwissen wrote:
I think this is just a case of independently developed backends where
developer picked different option names for the same thing. A patch is
welcome but note that it would break backward compatibility for a bunch
of unmaintained backends if you simply drop the black- and white-level
options :-o
To make chaos even more chaotic :-), sane-microtek uses OPT_SHADOW
internally, but with name SANE_NAME_BLACK_LEVEL, and the same for
OPT_HIGHLIGHT/SANE_NAME_WHITE_LEVEL.
FWIW, the version 2 draft of the standard documents shadow and highlight
at
https://sane-project.gitlab.io/standard/draft-2/api.html#shadow-option
https://sane-project.gitlab.io/standard/draft-2/api.html#highlight-option
so keeping that option is probably to be preferred.
Draft 2 defines these options as simple as follows, in pseudo-code:
if (c < SHADOW) {
c = BLACK;
} else if (c > HIGHLIGHT) {
c = WHITE;
} else {
c = c;
}
However, Photoshop, GIMP, XSane (on its software image enhancement) uses
the different interpretation (with formula I didn't yet understood), and
this interpretation seems to be common across image processing software.
How these options are interpreted by backends where they are handled by
hardware, probably nobody knows.
Looks, like both variants make sense and needs to be defined as
well-known options and documented.
The present definition, as it written in the draft 2, probably better
match the SANE_NAME_BLACK_LEVEL/SANE_NAME_WHITE_LEVEL pair.
What do you think?
--
Wishes, Alexander Pevzner ([email protected])