Gimp-Forum.net

Full Version: Scaling an image to a fixed file size
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there, newbie here.
I am a very basic user, doing simple, repetitive tasks, which typically involve cropping an image to a rectangular aspect ratio of 1.308:1 but to different pixel sizes. The online service the pictures are intended for has a maximum file size of 187kb per image, so I then scale my images, which are of different file sizes (so I can't use a default percentage scale), possibly 2 or 3 times until it is just under 187kb. 
Is there an easier way to scale my cropped image to a fixed file size?
Many thanks,
Jules.
(04-24-2024, 10:07 AM)julescousins Wrote: [ -> ]Hi there, newbie here.
I am a very basic user, doing simple, repetitive tasks, which typically involve cropping an image to a rectangular aspect ratio of 1.308:1 but to different pixel sizes. The online service the pictures are intended for has a maximum file size of 187kb per image, so I then scale my images, which are of different file sizes (so I can't use a default percentage scale), possibly 2 or 3 times until it is just under 187kb. 
Is there an easier way to scale my cropped image to a fixed file size?
Many thanks,
Jules.

An easier way ? I do not think so, You can get a file size estimate in Gimp but only for jpeg exports. 
In the jpeg export dialogue 
Set the sub-sampling to 4:2:2 - that gives smaller file sizes
Enable the show preview option and above that is a file size estimate that changes with the compression setting.

Depends on end use, but I would say, if the required compression value comes out below 70 then cancel the export / resize and try again.

[attachment=11741]
Maybe try this website > https://imagecompressor.11zon.com/en/res...e-to-187kb

it keeps the original file type and the ratio, just add multiple images then click the "Download zip" button, all below 187kb, and it seems free (at least for my tests)

[attachment=11742]
Thank you for those replies. I'll give them a go! ?
To scale a batch of photos to a given maximum size you can use RIOT :

https://riot-optimizer.com
[attachment=11770]
Possible tasks :  
[attachment=11771]
Fill in maximum file size :
[attachment=11772]