----- Original Message -----
> From: "Romano Giannetti" <romanof...@rgtti.com>

> On 07/03/18 11:32, Matthieu Moy wrote:
>> Before considering a fix: any idea how the "substract" operator should
>>> act in the Lab color space?
>> I have no idea ;-).
>> Actually, my guess is that "subtract" is useful to blend two totally
>> different images together (e.g. blend a black&white text onto an image
>> for a dodge&burn effect). For darktable where blending is done between
>> the original image and the image transformed by the module, I'm not
>> even sure "subtract" is a relevant thing to do. The fact that it's been
>> broken for years without anyone noticing is probably a sign that no
>> one ever found it useful.
> I am guilty of never using it in darktable, but the usage could be to
> see _where_ in the image the applied module is acting.

Actually, you already have "difference" for that.

The main expected difference between "difference" and "subtract" is the way
to deal with negative values. "difference" takes the absolute value, while
"subtract" (in Gimp, but the one in dt is not really a subtraction for now)
just clips negative values to 0.

"difference" (in dt at least) just outputs a black&white image saying how
much the input and the output pixels are different (black = same, white =
very different).

Now, what "subtract" should do with colors is debatable, especially in Lab.
On the L channel, something like max(in - out, 0) would be rather natural.
On the a an b channels, I'm not sure what to do. Just doing in-out would
mean the final image would be black&white if the input and the output pixels
have the same colors (the same a and b). They'd keep the same colors if the
output is black & white. But for example, if the input is magenta (positive a)
and the output is even more magenta (greater a), do we expect the output to
be black&white (a clipped to 0)? Or green (negative a)?

One way to avoid the question would be to do a difference only on the L
channel, but just copy a and b from the output.

Or perhaps another option would be to just deprecate and remove "difference"
if we assume no one's using it.


Matthieu Moy
darktable user mailing list
to unsubscribe send a mail to darktable-user+unsubscr...@lists.darktable.org

Reply via email to