Corrected channel count

When writing, a channel is now made based on the rgbchannel count. It is
assumed that the size c passed is effective size c and not absolute.