After obtaining the cross section of a 3D object having sphere holes inside it as shown in the picture below, I couldn't find a way to save it as either numpy array or any image format. I used the Trimesh code below to take the section:
slice = tm_build.section(plane_origin=tm_build.centroid,
plane_normal=[0,1,0])
slice_2D, to_3D = slice.to_planar()
slice_2D.show()