Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.47 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.47 KB

resize-image-by-percent

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)

Installation

  1. Download the scm files: https://github.com/gdog2u/resize-image-by-percent/archive/refs/head/master.zip
  2. Unzip and copy both .scm files to your GIMP scripts folder
    • e.g. ~/.config/GIMP/2.10/scripts/ or %APPDATA%/GIMP/2.10/scripts/

Parameters

The script has just two simple parameters:

  1. filepath
    • STRING - The absolute, or relative, path to an image
  2. percent
    • VALUE - An integer, greater than 0, that respresents by what percentage to scale the image

Examples

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

Contributions

I welcome any pull requests, and will consider them with respect.

Credits

@philcolbourn - Providing the basis for split-filename-extension.scm