How to reduce a jpeg size to a ‘desired size’?
I am still learning Python, so there may be better ways, but here is a function that saves a PIL/Pillow image as a JPEG and allows you to specify a maximum size. It uses a binary search to minimise the amount of work needed and it encodes into BytesIO memory buffer to save writing images … Read more