A GIMP script-fu script for use in the command line that allows for quickly resizing images by a certain percent. Written for GIMP v2.10.
(resize-image-by-percent "my-image.jpg" 25)
- Download the scm files: https://github.com/gdog2u/resize-image-by-percent/archive/refs/head/master.zip
- Unzip and copy both .scm files to your GIMP scripts folder
- e.g.
~/.config/GIMP/2.10/scripts/
or%APPDATA%/GIMP/2.10/scripts/
- e.g.
The script has just two simple parameters:
filepath
STRING
- The absolute, or relative, path to an image
percent
VALUE
- An integer, greater than 0, that respresents by what percentage to scale the image
Scale an image down to 25% its original dimensions
gimp -i -b '(resize-image-by-percent "James-at-the-beach.jpg" 25)' -b '(gimp-quit 0)'
Increase an image by 50%
gimp -i -b '(resize-image-by-percent "in-the-garden.jpg" 150)' -b '(gimp-quit 0)'
Scale down an entire folder of images
#!/bin/bash
for FILE in pictures/*
do
gimp -i -b "(resize-image-by-percent \"$FILE\" 33)" -b '(gimp-quit 0)'
done
I welcome any pull requests, and will consider them with respect.
@philcolbourn - Providing the basis for split-filename-extension.scm