def convert_rgb_to_bokehrgba(img_data, downsample=1):
 if (img_data.dtype != np.uint8):
  raise NotImplementedError
 if (img_data.ndim != 3):
  raise NotImplementedError
 img_data = img_data[::(- downsample), ::downsample, :]
 (img_h, img_w, C) = img_data.shape
 bokeh_img = np.dstack([img_data, (255 * np.ones((img_h, img_w), np.uint8))])
 final_image = bokeh_img.reshape(img_h, (img_w * (C + 1))).view(np.uint32)
 return final_image

def convert_rgb_to_bokehrgba ( img_data , downsample = 1 ) : if ( img_data . dtype != np . uint8 ) : raise NotImplementedError if ( img_data . ndim != 3 ) : raise NotImplementedError img_data = img_data [ : : ( - downsample ) , : : downsample , : ] ( img_h , img_w , C ) = img_data . shape bokeh_img = np . dstack ( [ img_data , ( 255 * np . ones ( ( img_h , img_w ) , np . uint8 ) ) ] ) final_image = bokeh_img . reshape ( img_h , ( img_w * ( C + 1 ) ) ) . view ( np . uint32 ) return final_image
convert rgb image to two-dimensional array of rgba values .