I have this image and I read as a PIL file. Then, I save it back using save
method in PIL and imwrite
method in cv2
. Saving the image with imwrite
downgrades the image quality (it becomes black and white and text can't be read).
image = Image.open("image.png")
cv2_image = numpy.asarray(image)
image.save("pil.png")
cv2.imwrite("opencv.png", cv2_image)
Here are the output files: