Hello Dave, > I think you correctly recognized that you need to round rather than > truncate the result, but you only rounded one term instead of the total: > > Original: > filt = filt + (new - filt) / 2; > > Rounded: > filt = ((filt*2 + (new*2 - filt*2) / 2) + 1) / 2; > filt = ((254*2 + (255*2 - 254*2) / 2) + 1) / 2; > filt = ((508 + (510 - 508) / 2) + 1) / 2; > filt = ((508 + 2 / 2) + 1) / 2; > filt = (509 + 1) / 2; > filt = 510 / 2; > filt = 255; you are right! Dumb me... Saddly, your solution suffers from a problem I haven't seen when I wrote the original post. The filter don't go from 1 to 0: filt = ((filt*2 + (new*2 - filt*2) / 2) + 1) / 2; filt = ((1*2 + (0*2 - 1*2) / 2) + 1) / 2; filt = ((2 + (0 - 2) / 2) + 1) / 2; filt = ((2 + (-1)) + 1) / 2; filt = (1 + 1) / 2; filt = 2 / 2; filt = 1; Thank you, Brusque ----------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil Say NO to HTML mail www.citronics.com.br ----------------------------------------------------------------- -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body