Extreme close-up of a dark textured metallic surface with soft red-pink highlights, moody and industrial
●
Software Listings

Vstpirate posts download pages for applications like Acronis Cyber Backup and Boilsoft Apple Music Converter, alongside categories for Mac, Windows, audio plugins and Android tools.

↓

Batch resize images with GIMP scripts

Batch resizing images with GIMP scripts turns a repetitive export job into a predictable process. A script can read a folder, fit every picture to the same long edge, save copies with familiar filenames and close each file after processing. That leaves you with time to check composition, colour and the details that matter to the finished project.

This guide builds a workflow for GIMP 2.10 LTS using Python-Fu, GIMP’s scriptable Python interface, then shows how to run it from the Script-Fu console or a terminal. The examples suit web galleries, property listings and product catalogues: a Brisbane property photographer may receive dozens of landscape and portrait frames, while a Melbourne maker needs consistent catalogue images for a weekend market.

Prepare a predictable workspace

Create separate source, destination and working folders before touching the script. Put copies of the files you want to process in the source folder and leave originals in your archive. Keep the first destination empty, and the example writes results to a different directory, reducing the risk of an accidental overwrite while you test.

Choose a target size based on the longest side rather than a fixed width. A 4,000-by-3,000 image resized to a 1,600-pixel long edge becomes 1,600 by 1,200, while its portrait companion becomes 1,200 by 1,600. Images already within the limit stay the same size, so small files are never enlarged.

Build the batch-resize script

Save the following as batch_resize.py. It handles JPG, PNG, WebP and TIFF files, skips subfolders and opens one image at a time. The merge step prepares a single-layer export, so animated or multi-page sources need a different workflow.

import os
from gimpfu import pdb

def resize_folder(source, destination, long_edge=1600):
    if not os.path.isdir(destination):
        os.makedirs(destination)

    for filename in sorted(os.listdir(source)):
        source_path = os.path.join(source, filename)
        if not os.path.isfile(source_path):
            continue

        base_name, extension = os.path.splitext(filename)
        extension = extension.lower()
        if extension not in (
            ".jpg", ".jpeg", ".png", ".webp", ".tif", ".tiff"
        ):
            continue

        image = pdb.gimp_file_load(source_path, source_path)
        try:
            width, height = image.width, image.height
            scale = min(1.0, float(long_edge) / max(width, height))
            new_width = max(1, int(round(width * scale)))
            new_height = max(1, int(round(height * scale)))

            if (new_width, new_height) != (width, height):
                pdb.gimp_image_scale(image, new_width, new_height)

            pdb.gimp_image_merge_visible_layers(image, pdb.CLIP_TO_IMAGE)
            drawable = pdb.gimp_image_get_active_drawable(image)

            destination_path = os.path.join(
                destination, base_name + extension
            )
            pdb.gimp_file_save(
                image, drawable, destination_path, destination_path
            )
        finally:
            pdb.gimp_image_delete(image)

resize_folder(
    "/Users/alex/Images/resize-test/input",
    "/Users/alex/Images/resize-test/output",
    1600
)

The calculation uses the larger original dimension and rounds the other side to preserve the aspect ratio. The try/finally block releases each image even if an export fails. Python-Fu uses Python 2.7 in GIMP 2.10, so keep the script within that syntax; later GIMP releases require checking the available Python integration.

Script-Fu is GIMP’s native language and remains available where the Python-Fu bridge is absent. The same operations—load, scale, merge, save and delete—exist in both systems, but Script-Fu uses TinyScheme syntax and different file-listing functions. Either interpreter can be selected from the command line.

Run the script without the interface

In GIMP, open Filters > Script-Fu > Console. Replace the path below with your own, then run the commands. The first executes the Python file, whose final line calls resize_folder; the second closes GIMP cleanly.

(python-fu-eval RUN-NONINTERACTIVE "execfile('/Users/alex/Images/resize-test/batch_resize.py')")
(gimp-quit 0)

Headless runs suit repeat exports and scheduled jobs. Use the executable installed on your computer rather than assuming every system has the same name:

# macOS
"/Applications/GIMP.app/Contents/MacOS/gimp-2.10" -i -b '(python-fu-eval RUN-NONINTERACTIVE "/Users/alex/Images/resize-test/batch_resize.py")' -b '(gimp-quit 0)'

# Linux
gimp -i -b '(python-fu-eval RUN-NONINTERACTIVE "/home/alex/resize-test/batch_resize.py")' -b '(gimp-quit 0)'

# Windows PowerShell
& "C:\Program Files\GIMP 2\bin\gimp-2.10.exe" -i -b '(python-fu-eval RUN-NONINTERACTIVE "C:/Photos/resize-test/batch_resize.py")' -b '(gimp-quit 0)'

On macOS, Terminal usually keeps the single quotes intact. PowerShell may need the call operator, shown as &, before a quoted executable path. If the console reports a missing file, use forward slashes in the script path and confirm its name. If no output appears, check the extension list and folder permissions.

Choose resize rules that fit the job

Long-edge resizing suits galleries, property portals and email campaigns because it preserves the photographer’s framing. It will not turn a 3:2 photograph into a square marketplace thumbnail. For a square product image, add a deliberate crop after scaling, centring the label and checking that no edge is clipped. Square product photographs are common in Australian online retail, so give this step its own template rather than hiding it in the batch script.

Keep full-resolution masters as PNG, TIFF or high-quality JPG, and treat the resized set as a delivery copy. A 1,600-pixel image suits a website but cannot replace a high-resolution file for a large print. Scaling also cannot repair soft focus, motion blur or an incorrect white balance, so review colour before approving the batch.

Handle originals and awkward files

Never point a first run at your only masters. Begin with about ten copied images, including a small file, a portrait and a transparent PNG if you work with them. Uppercase extensions are still recognised. Unsupported files are skipped rather than converted, making the output count easy to compare with the expected count.

Transparency and layered artwork need care. Merging visible layers creates a single deliverable, but it may flatten a multi-page TIFF or the frames of an animated WebP. If the deliverable must retain layers, save XCF masters and run a separate export pass. Inspect transparent PNGs against a contrasting background, since pale edges can look clean on white and disappear elsewhere.

Australian customer work also deserves a metadata check. GIMP’s handling of EXIF, GPS coordinates and embedded thumbnails varies with format and export settings, so do not assume private location data has been removed. Review a sample outside GIMP before uploading files shot at home or on site. Keep unreleased client work on encrypted storage and follow your organisation’s access rules.

Check results before publishing

Spot-check three outputs at 100 per cent: one landscape, one portrait and one with text or fine edges. Look for jagged lettering, halos and colour shifts. Open several files in GIMP as layers, shrink them into a contact sheet and inspect the sheet as a whole. That overview can reveal an incorrect crop that individual checks miss.

Compare eligible source files with files written to the destination. Add a print statement to the script if you want each filename and new dimension in the console, then keep the log with the job. Record the GIMP version, target edge, colour treatment and script filename in a short note, making a hand-over less dependent on memory.

Use the workflow across Australian teams

For a small Australian studio, GIMP’s free licence keeps the tool cost down while paid design software remains in the production budget. Commercial subscriptions may be quoted in Australian dollars with 10 per cent GST, and finance teams often need a tax invoice rather than a general download receipt. GIMP requires no activation key; CorelDRAW licence details belong to a separate commercial product. This CorelDRAW serial key guide illustrates that different licensing route, not a step in the GIMP process.

Timing matters in the southern hemisphere. Australian retailers often prepare Christmas campaigns in spring, while tourism operators build image libraries before summer and winter travel seasons. A Sydney accommodation team and a Perth nature photographer may both need consistent web dimensions, but their colour and crop decisions will differ. Set the target edge in the script, then review representative photographs before approving a full batch.

Shared workflows need a simple hand-over, not a complicated production system. Store the script, sample inputs and written settings together in a project folder, with one person responsible for changes. Use Australian spelling such as licence and colour in notes so they read naturally for local teams. Give it a go with a small copied batch first, then schedule the larger run once the checks are familiar.


Turn the manual grind into a repeatable export by installing GIMP 2.10 LTS from its official project site, saving the script and running it against a copied test folder before processing a client shoot. Keep the same script for the next batch and adjust only the target edge or crop rules.

Download GIMP, create your source and destination folders, and run your first ten-image batch today.