implementing read/put horizontal line of pixels