Jump to content
phdphd

Resize An Image To a Specific "Byte" Size

Recommended Posts

Hi All,

Just wondering whether it is possible to resize a jpg image to a specific size in bytes (while preserving height/width ratio).

Thanks for any clues!

Share this post


Link to post
Share on other sites

Not tested, but you could try this

Calc the resize factor (R) as sqrt(required_size / orig_size)

Multiply the orig height and width by R to get new dimensions

image.png.9bf905977cb631e7b1d5274912ecc967.png

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.