use pixel access for efficiency