Cannot show result of edge detection

I got the solution for my problem, I save the array with cv2, and then I call it again

gambarK = np.array(kirsch(image))
gambarR = np.array(robinson(image))

cv2.imwrite("hasilK.jpeg",gambarK)
cv2.imwrite("hasilR.jpeg",gambarR)

citra_DTK =  cv2.imread('hasilK.jpeg')
citra_DTR =  cv2.imread('hasilR.jpeg')

finaly store it in anvil media

   
def image():
    DTK_byte_arr = io.BytesIO()
    DTR_byte_arr = io.BytesIO()

    DTK = Image.fromarray(citra_DTK)
    DTK.save(DTK_byte_arr,format="JPEG")
    img_DTK = DTK_byte_arr.getvalue()
    media_DTK = anvil.BlobMedia(content_type="image/jpeg", content=img_DTK)
    
    DTR = Image.fromarray(citra_DTR)
    DTR.save(DTR_byte_arr,format="JPEG")
    img_DTR = DTR_byte_arr.getvalue()
    media_DTR = anvil.BlobMedia(content_type="image/jpeg", content=img_DTR)

    return([ media_DTK, media_DTR])

that’s looks silly but it works