Send Webcam captured image (getusermedia api) from frontend JS to backend flask

I am trying to capture a webcam image in the front end using the getUserMedia API and transfer it to my backend flask. The quality and resolution of the image should be 100% intact. How can I transfer it so its resolution, size, and quality remain exactly the same after receiving it in the backend?