optimize color reducing for speed