Ask Your Question

Revision history [back]

Two ways to solve your problem:

  1. Take absolute difference between pixels. You will get the difference but lose the direction of difference.
  2. Scale the difference such that -minval corresponds to 0. For example, you could scale it such that -255 is zero. In that case, your red which is -28 will show up as 227. You can adjust the code semantics to handle the rest.