| <<< Home | << Web | < Arithmetic | Top | Bottom | < Prev | Next > |
Given an image with color values (a,b,c) and another with values (x,y,z), the lightest and darkest functions look at the corresponding values and choose the larger (lightest) or smaller (darkest) value. Note that this is done on the three individual values rather than on the color as a whole. If one image has a value of red (255,0,0) and the other has green (0,255,0), lightest will produce yellow (255,255,0) while darkest will produce black (0,0,0).
You will normally want to use a divisor of 1 and a bias of 0. As usual, you can use a positive bias value to lighten up a result and either a negative bias value or a larger divisor to darken it up.
Unless you specify a non-zero bias, clipping has no effect because you'll never have results outside the range 0 through 255. A positive bias can cause values larger than 255, and a negative bias can cause values less than 0, and you'll probably get better results with clipping enabled.
As with the other functions, black and white act in special ways if the divisor is 1 and the bias is 0:
Here's some examples using a divisor of 1 and a bias of 0:
| Value 1 | Value 2 | Lightest | Darkest |
|---|---|---|---|
| (128,64,192) | (32,192,128) | (128,192,192) | (32,64,128) |
| (255,255,0) | (0,255,255) | (255,255,255) | (0,255,0) |
| (255,0,0) | (0,128,128) | (255,128,128) | (0,0,0) |
| <<< Home | << Web | < Arithmetic | Top | Bottom | < Prev | Next > |