diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-20 16:02:49 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-20 16:02:49 +0100 |
| commit | 4b732ac07bbe8163a112e5b7fa61278833ad9285 (patch) | |
| tree | 5aa450ed3db2dd749606bc4be1745c387cba0475 /src | |
| parent | Add man pages (diff) | |
| download | blind-4b732ac07bbe8163a112e5b7fa61278833ad9285.tar.gz blind-4b732ac07bbe8163a112e5b7fa61278833ad9285.tar.bz2 blind-4b732ac07bbe8163a112e5b7fa61278833ad9285.tar.xz | |
Explaination of why blind-set-luma may look weird
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
| -rw-r--r-- | src/blind-set-luma.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/blind-set-luma.c b/src/blind-set-luma.c index 71bd59c..49cbc08 100644 --- 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. */ } } |
