Skip to content

A GIMP script-fu script to easily change an image's size by a percentage

License

Notifications You must be signed in to change notification settings

gdog2u/resize-image-by-percent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A GIMP script-fu script to easily change an image's size by a percentage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages