blind

suckless command-line video editing utility
git clone git://git.suckless.org/blind
Log | Files | Refs | README | LICENSE

commit 4b732ac07bbe8163a112e5b7fa61278833ad9285
parent d2b8e19411dae84059104441bd186bbdf35df7e3
Author: Mattias Andrée <maandree@kth.se>
Date:   Fri, 20 Jan 2017 16:02:49 +0100

Explaination of why blind-set-luma may look weird

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
Msrc/blind-set-luma.c | 34+++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/blind-set-luma.c b/src/blind-set-luma.c @@ -26,7 +26,8 @@ process_xyza(struct stream *colour, struct stream *luma, size_t n) * so the result may look a bit weird. To change both * you can use `blind-arithm mul`. * - * Explaination: + * Explaination of algorithm: + * * Y is the luma, but (X, Z) is not the chroma, * but in CIELAB, L* is the luma and (a*, *b) is * the chroma. Multiplying @@ -50,6 +51,37 @@ process_xyza(struct stream *colour, struct stream *luma, size_t n) * ⎛1 1 0⎞⎛a 0 0⎞⎛0 1 0⎞ ⎛1 a−1 0⎞ * ⎜1 0 0⎟⎜0 1 0⎟⎜1 −1 0⎟ = ⎜0 a 0⎟. * ⎝0 0 −1⎠⎝0 0 1⎠⎝0 1 −1⎠ ⎝0 a−1 1⎠ + * + * Explanation of why changing only the luma looks weird: + * + * Consider when you are workings with colours, + * when you want to change the brightness of a + * colour, you multiply all parameters: red, green, + * and blue, with the same value (this is however + * only an approximation in most cases, since you + * are usually usally working with colours that + * have the sRGB transfer function applied to their + * parameters). This action is the same in all + * colour models and colour spaces that are a + * linear transformation of the sRGB colour spaces + * (sans transfer function); this is simply because + * of the properties of linear transformations. + * + * The reason you change brightness this way can + * be explained by how objects reflect colour. + * Objects can only reject colours that are present + * in the light source. A ideal white object will look + * pure red if the light sources is ideal red, and a + * a ideal blue object will pure black in the same + * light source. An object can also not reflect + * colours brighter than the source. When the brightness + * of a light source is changed, the intensity of all + * colours (by wavelength) it emits is multiplied by + * one value. Therefore, when changing the brightness + * it looks most natural when all primaries (red, green, + * and blue) are multiplied by one value, or all + * parameters of the used colour spaces is a linear + * transformation of sRGB, such as CIE XYZ. */ } }