Adapted filtering algorithm- RGB