add n_components casting test
improve how RGBA buffers are copied to n_component