Payload too large while uploading images to server

Is there a way to compress the image captured by the application without losing image resolution?
I’m using Ionic 4 with a capacitor to capture the image as a Base64 string. While sending the string to the server, the payload too large error is received.
Any sort of help is appreciated. Thank you…!