I'm using GIMP to do a simple but tedious operation for many images so I'd like to know how I can make a script that will do it for me, or find some simpler way of doing this.
I import an image file that has large dimensions but is mostly square, sometimes like 550x564, 580x596, etc., which may be jpg, bmp, or png, and I want to export a 192x192 PNG file, resized and cropped on both ends of the longer dimension, which is usually vertical but can be horizontal.
I perform the following steps for an image that is longer vertically than it is horizontally:
- Image->Scale Image->Set Width to 192 (Locked, so Height will automatically be set to something like 196)
- Click Scale
- Image->Canvas Size->Set Height to 192
- Click Center
- Click Resize
- File->Export As->same file name but extension changed to .png, and PNG image selected from the dropdown list (usually the original files are jpg, but sometimes they are png, so overwrite if necessary)
- Click Export (Click Load Defaults)
- Click Export again
How can I do this in script-fu or python for GIMP? Or in ImageMagick? Or is there a better way of making a macro for this?