First off part of me feels like this is a stupid question, sorry about that. Currently the most accurate way I\'ve found of calculating the optimum scaling factor (best width an
I think the fastest and cleaner way is:
from PIL import Image from math import sqrt img=Image.open(PATH) img.thumbnails([round(sqrt(TARGET_PIXEL_AREA))]*2)
I hope it will help