change numchannels to numpixels