Fix 4 and 8 bit RGB/BGR input.