Implementing brightness algorithm as filter