sgi: encode images with 4 channels at 8 and 16 bits