1import io
2from PIL import Image
34# Encode your PIL Image as a JPEG without writing to disk5buffer = io.BytesIO()
6YourImage.save(buffer, format='JPEG', quality=75)
78# You probably want9desiredObject = buffer.getbuffer()
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content