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.