import bpy
img=bpy.data.images["preview2.png"]
w,h=img.size
px=list(img.pixels)
# sample some pixels
n=len(px)
step=w*h//10
samples=[(round(px[i*4],2),round(px[i*4+1],2),round(px[i*4+2],2)) for i in range(0,10)]
# also center pixel
cx=(h//2*w + w//2)*4
result={"samples":samples,"center":(round(px[cx],2),round(px[cx+1],2),round(px[cx+2],2))}