Layer Modes formulas
This discussion is connected to the gimp-docs-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
Layer Modes formulas | Ry?Ta SimaMoto | 08 Nov 18:51 |
Layer Modes formulas | Ulf-D. Ehlert | 16 Nov 20:22 |
Layer Modes formulas | SimaMoto, Ry?Ta | 18 Nov 17:02 |
Layer Modes formulas | Ulf-D. Ehlert | 22 Nov 13:16 |
1137.76.122.174.227.1258923... | 07 Oct 20:29 | |
Layer Modes formulas | Ulf-D. Ehlert | 23 Nov 18:03 |
Layer Modes formulas
Hi,
I send patches for bugzilla which refresh mathematical formulas of the "Layer Modes" page. #601156
Some formulas are reformed. * Multiplication signs '*' are all removed because they can be omitted in almost regular mathematic expressions. * Nested parentheses are changed in their sizes gradually.
Sizes are increased slightly more larger, but these file size are reduced.
Style of formula is changed to TeX's mathematical display mode.
%% plainTeX
% multiply
$$E = {M I \over 255}$$
% divide
$$E = {256 I \over M + 1}$$
% screen
$$E = 255 - {(255-M) (255-I) \over 255}$$
% overlay
$$E = {I\over255} \left(I + {2M\over255}(255-I)\right)$$
% dodge
$$E = {256I \over (255-M) + 1}$$
% burn
$$E = 255 - {256(255-I) \over M + 1}$$
% hard light 1
$$E = 255 - { \{255 - 2(M-128)\}(255-I) \over 256},\qquad M > 128$$
% hard light 2
$$E = {2 M I \over 256},\qquad M \le 128$$
% soft light (screen)
$$R_{s} = 255 - {(255-M)(255-I) \over 255}$$
% soft light
$$E = {(255-I)M + R_{s}\over255}I$$
% addition
$$E = min\bigl( (M + I), 255\bigr)$$
% subtract
$$E = max\bigl( (I - M), 0\bigr)$$
\nopagenumbers
\end
%%
PDF file is here:
http://www.geocities.jp/ss2pxd1c/layermodes.pdf
Can this reformation be acceptable for all users?
https://bugzilla.gnome.org/show_bug.cgi?id=601156
-=-=-=-=-=
SimaMoto,Ry?Ta
Layer Modes formulas
RyÅTa SimaMoto (Sonntag, 8. November 2009, 18:51):
Some formulas are reformed.
* Multiplication signs '*' are all removed because they can be omitted in almost regular mathematic expressions.
But sometimes the expression is more readable with a "*", IMHO: "256 * I" vs. "256I"
Style of formula is changed to TeX's mathematical display mode.
There are some braces left over from \frac. BTW, why did you replace "\frac" with "\over"? (I'm TeX/LaTeX beginner...)
Can this reformation be acceptable for all users?
I wonder if we shouldn't make some more fundamental changes:
It looks like layer/blend mode formulas are typically expressed using values in the range 0..1. This makes them independent of the color depth and simplifies the equations (e.g. "E = M * I" for the multiply mode).
If we just want/need to explain layer modes without describing any internal details of how to compute the "real" values, we should consider switching to the - as far as I see - common way to describe layer/blend modes.
I found some nice links here: http://lists.xcf.berkeley.edu/lists/gimp-developer/2009-October/023624.html
Ulf
Layer Modes formulas
2009/11/17 Ulf-D. Ehlert :
But sometimes the expression is more readable with a "*", IMHO: "256 * I" vs. "256I"
There are some braces left over from \frac. BTW, why did you replace "\frac" with "\over"? (I'm TeX/LaTeX beginner...)
Then I will insert \times multiplication sign. Please check the bug#601156 (attachment #148040). I'm rarely familiar with LaTeX, so I used plain TeX. It is easy to get the TeX BOOK on the Net.
I wonder if we shouldn't make some more fundamental changes: ...
I approve your idea. Will it be like this?: http://www.geocities.jp/ss2pxd1c/snapshots/layermodesU.la.pdf
-=-=-=-=-= SimaMoto,Ry?Ta
Layer Modes formulas
SimaMoto, RyÅTa (Mittwoch, 18. November 2009, 17:02):
I approve your idea. Will it be like this?: http://www.geocities.jp/ss2pxd1c/snapshots/layermodesU.la.pdf
Yes, assuming these formulas are correct, of course. ;-)
No feedback from anybody else? (What does it mean - good / bad / don't care?)
Ulf
Layer Modes formulas
Andy Pitonyak (Sonntag, 22. November 2009, 21:50):
When I see something like "A x B", I do not assume that A is multiplied by B; I assume that a cross product will occur. I will concede that 2A is more readily understood as 2 times A than AB is A times B, but, for anyone that understands the math, that one particular notation may prove unsettling.
Hmm, and I thought we should even replace "E = min((M + I),255)" with "E = M + I" (plus a footnote or so) because the first formula might be too complicate for some users... ;-)
I will concede that in different places and at different levels, both the cross product (like an x) and dot product (a single dot) symbols are used to represent multiplication. I usually only see this in very introductory level material.
Using the "x" (ISO-8859-1 / Unicode 0xD7) as "simple" multiplication
sign seems to be a standard for texts created (or used) by computer
programs. (Most programmers would probably use the familiar "*", and
you would never find it e.g. in a German math book, though.)
Same with the division sign (÷) -- a kind of standard(?), but it seems
that nobody uses it.
(If I remember correctly we used this division sign at school when we
learned how to divide integers...)
If you do choose to use a symbol to represent multiplication I strongly recommend extra text explaining this with perhaps a foot note when this format is used.
We should get rid of any problems if we use the \cdot macro, which produces the usual multiplication symbol.
I recommend against this usage. I do not expect to ever see it in cases such as 1-2(1-1/2), or (A-B)(C+D).
These are good examples where we could easily omit any multiplication symbol. But a formula like "256I" (with 'I' in italics) looks ugly, and e.g. "E = MI" may look a bit weird outside the math lessons.
So my suggestions is that we use \cdot if the formula looks better with a multiplication symbol, and don't use any multiplication symbol otherwise.
Ulf