I run a social media scheduling tool and Twitter requires that images don't exceed 524kb.
Is it possible, using this library, to automatically create the "perfect" combination of scaling and quality to achieve a target size of 524kb?
For example, if an image is 10,000 pixels wide and is 10mb and optimising it to a combination 2,000 pixels wide and 90% quality would make it 523kb then we go with that.
The preference would be a minimum of 90% quality and as high a resolution as possible.
Any ideas?