Re: Rookie having problems with some filter code. Any help?
- From: davem@xxxxxxxxx (Dave Martindale)
- Date: Wed, 14 Dec 2005 03:31:43 +0000 (UTC)
Don Bruder <dakidd@xxxxxxxxx> writes:
>However, you bring up a valid point - one which I've been struggling
>with - How to cope with (A) color values that go negative while being
>"cooked", and (B) values that overflow the available 8 bits while being
>cooked. For situation B, a simple "value % 256" leaps to mind as the
>proper treatment. But coping with values that land in "negative-ville"
>as a result of being cooked, whether they are or are not possible to fit
>into 8 bits, is something that has me completely stumped.
If you're just going to write out the image again, negative values
should be clamped to zero, and values greater than 255 should be clamped
to 255 - not wrapped around to zero. But if you're going to do a chain
of operations, and you don't have to convert back to 8 bits unsigned
between each operation, there is sometimes a benefit to carrying the
unclamped values through the whole sequence of steps and clamp only at
the end.
There are occasions (e.g. differencing) when keeping the result mod 256
is the right thing to do - but that's not usually the case.
Dave
.
- Follow-Ups:
- Re: Rookie having problems with some filter code. Any help?
- From: Don Bruder
- Re: Rookie having problems with some filter code. Any help?
- References:
- Rookie having problems with some filter code. Any help?
- From: Don Bruder
- Re: Rookie having problems with some filter code. Any help?
- From: jg . campbell . ng
- Re: Rookie having problems with some filter code. Any help?
- From: Don Bruder
- Rookie having problems with some filter code. Any help?
- Prev by Date: Re: Luminance and RGB layers question
- Next by Date: Re: Rookie having problems with some filter code. Any help?
- Previous by thread: Re: Rookie having problems with some filter code. Any help?
- Next by thread: Re: Rookie having problems with some filter code. Any help?
- Index(es):
Relevant Pages
|