My program needs a numpy array for processing, so I convert GEE image into numpy array using this code:
# Define an image.
img1 = ee.Image( 'LANDSAT/LC08/C01/T1_SR/LC08_038029_20180810') \
.select(['B2','B3','B4', 'B5', 'B6'])
new=img1.toArray().toArray(1)
# Define an area of interest.
aoi = ee.Geometry.Polygon(
[[[-110.8, 44.7],
[-110.8, 44.6],
[-110.6, 44.6],
[-110.6, 44.7]]], None, False)
# Get 2-d pixel array for AOI - returns feature with 2-D pixel array as property per band.
band_arrs = img1.sampleRectangle(region=aoi)
# Get individual band arrays.
band_arr_b2 = band_arrs.get('B2')
band_arr_b3 = band_arrs.get('B3')
band_arr_b4 = band_arrs.get('B4')
# Transfer the arrays from server to client and cast as np array.
np_arr_b2 = np.array(band_arr_b2.getInfo())
np_arr_b3 = np.array(band_arr_b3.getInfo())
np_arr_b4 = np.array(band_arr_b4.getInfo())
# Expand the dimensions of the images so they can be concatenated into 3-D.
np_arr_b2 = np.expand_dims(np_arr_b2, 2)
np_arr_b3 = np.expand_dims(np_arr_b3, 2)
np_arr_b4 = np.expand_dims(np_arr_b4, 2)
# Stack the individual bands to make a 3-D array.
rgb_img = np.concatenate(( np_arr_b4,np_arr_b3,np_arr_b2), 2)
Now can I go back from numpy array to GEE image?