Jump to content

Utility for finding maximum resolutions at different aspect ratios..

APasz
Go to solution Solved by Kilrah,

In Gimp you have a "tool presets" window, open that. You'll find several presets for the crop tool with various aspect ratios. Click the one you need, then select the area you want to keep. Double click, save as. 

You can make more presets with other ratios.

Every now and then I get anywhere up to a few hundred pictures that need to be cropped. Usually it's 2x3, 3x2, 16x9, 9x16, 21x9, and 32x9.

This wouldn't be a problem if all the pictures were all the same size but they often aren't.

 

Is there a Gimp addon or separate utility where I can input the resolution of picture, and get back resolutions at the above ratios that also fit within the original resolution?

-アパゾ

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not 100% what you're asking. Are you saying you want to e.g. resize all images with a 16:9 aspect ratio to a certain size (e.g. 1080p)? Or are you saying you want to crop the images to fit within a certain aspect ratio and then resize the images?

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Sounds like what you need is cropping, not resizing since that would distort the image.

What you crop out would likely be different for each image, so an automated task wouldn't do a very good job.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

Yeah I mean crop, sorry.

I'll explain it a another way.

Original image is say 2500x2500

I'd like to crop the image so I've got a 2x3 version, and a 16x9 version, etc.

So the sizes would be 3x2 2500x1667, 16x9 2500x1406, 21x9 2500x1047, and 32x9 2500x703.

 

At the moment I'm using https://andrew.hedges.name/experiments/aspect_ratio/ and doing it all manually.

 

-アパゾ

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, APasz said:

Yeah I mean crop, sorry.

I'll explain it a another way.

Original image is say 2500x2500

I'd like to crop the image so I've got a 2x3 version, and a 16x9 version, etc.

So the sizes would be 3x2 2500x1667, 16x9 2500x1406, 21x9 2500x1047, and 32x9 2500x703.

 

At the moment I'm using https://andrew.hedges.name/experiments/aspect_ratio/ and doing it all manually.

 

I you want to crop an image to fit within a certain aspect ratio, you need to keep one dimension of the image fixed (either width or height) and resize the other one to match the aspect ratio. To get the required size, you can simply reverse the calculation to get the aspect ratio.

 

If you have an image with say 1920x1200 (16:10) pixels and you want to crop that to fit the 16:9 aspect ratio, you can do:

1920 / (16/9) = 1080 -> This works, we can crop the height to 1080

1200 * (16/9) = 2133 -> This does not work, we can't increase the width to 2133

 

You might be able to automate that task with e.g. ImageMagick. Get the resolution of the image, figure out which way to crop it (horizontal or vertical) and then use ImageMagick to crop to the resulting size.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

In Gimp you have a "tool presets" window, open that. You'll find several presets for the crop tool with various aspect ratios. Click the one you need, then select the area you want to keep. Double click, save as. 

You can make more presets with other ratios.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Kilrah said:

In Gimp you have a "tool presets" window, open that. You'll find several presets for the crop tool with various aspect ratios. Click the one you need, then select the area you want to keep. Double click, save as. 

You can make more presets with other ratios.

You should be able to automate this job with ImageMagick: https://stackoverflow.com/a/41618723

 

You could use a simple script that loops over all files and then uses ImageMagick to crop the images to the aspect ratios you need.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

If you want a good job the area you want to keep isn't necessarily always the center. From one image you might want to crop more of the top, some more of the bottom, some you might want to reframe a bit tighter while you're at it instead of using the full existing width... no automated solution will do that for you, but the solution I gave lets you do it reasonably quickly and without OP's manual calculations... 

 

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Kilrah said:

In Gimp you have a "tool presets" window, open that. You'll find several presets for the crop tool with various aspect ratios. Click the one you need, then select the area you want to keep. Double click, save as. 

You can make more presets with other ratios.

I had no idea that was a thing. Thanks a whole bunch mate.

 

2 minutes ago, Eigenvektor said:

You should be able to automate this job with ImageMagick: https://stackoverflow.com/a/41618723

 

You could use a simple script that loops over all files and then uses ImageMagick to crop the images to the aspect ratios you need.

I'll look into that. Thanks.

-アパゾ

Link to comment
Share on other sites

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

×