<<< Home << Web < Arithmetic Top Bottom < Prev Next >

Image Arithmetic
Add - Effect of Bias

Review

To recap the previous pages, when you add using divisor=1, bias=0 you simply add the separate red, green and blue values:

(a,b,c) + (x,y,z) = (a+x,b+y,c+z)

When you change the divisor to a larger value d, the formula becomes

(a,b,c) + (x,y,z) = ( (a+x)/d , (b+y)/d , (c+z)/d)

Bias

When you specify a non-zero bias, the bias is added to each of the resultant values:

  (a,b,c) + (x,y,z) = ( (a+x)/d + bias , (b+y)/d + bias , (c+z)/d + bias)

For example:

Bias = 0: (15,30,90) + (90,20,10) = (105,50,100)
 
Bias = 50: (15,30,90) + (90,20,10) = (155,100,150)
 
Bias = -50: (15,30,90) + (90,20,10) = (55,0,50)

A positive bias value lightens the result, while a negative bias darkens the result. There are other methods of lightening or darkening a result by using other PSP features such as gamma correction or brightness/contrast adjustment after performing an add. You may need to experiment with all of these to see whether a bias value or the other methods produce the best result for a particular pair of images.

When using a divisor of 2 or larger with zero bias, the results are always values between 0 and 255. Specifying a bias value may push results outside the 0-255 range.

A negative bias may push values into the negative range. If you specify clipping, these values are set to 0. Otherwise, they wrap around (2, 1, 0, 255, 254, ...). A value of 256 is added to negative values.

Similarly, a positive bias may push values beyond 255. As usual, clipping sets these to 255 and non-clipping wraps them around by subtracting 256.

In either case, you will usually get better results with clipping. The artifacts produced by the wrap-around method occasionally produce an interesting result but more often than not just results in a mess.

When you use a non-zero bias, you may reduce the number of possible colors that can appear in the result:

  Before clipping After clipping
  Smallest Largest Smallest Largest
Divisor 1
Bias 0
0 510 0 255
Divisor 1
Bias 100
100 610 100 255
Divisor 1
Bias -100
-100 410 0 255
Divisor 2
Bias 0
0 255 0 255
Divisor 2
Bias 100
100 355 100 255
Divisor 2
Bias -100
-100 155 0 155

<<< Home << Web < Arithmetic Top Bottom < Prev Next >