I'm trying to make a rest API, and I came across this line of code-
_, img_encoded = cv2.imencode('.jpg', image)
What does this do? I unfortunately can't use OpenCV for m project, so is there any way I can achieve the same thing with PIL? Thanks, in advance!