8

I would like to execute some actions in Gimp and then apply this actions again to a new version of the file.

Is it possible ?

Edit: I would like to crop (and center the rest), resize. Maybe change background too.

2
  • This page could be helpful.
    – terdon
    Dec 6, 2012 at 15:48
  • What kind of actions are you talking about? Simple resizing or color swap, or is it drawing shapes and things like that?Please give an example.
    – terdon
    Dec 6, 2012 at 16:10

1 Answer 1

6

There are two things you could try. The first is GIMP scripting or GIMP BATCH. These are ways of running GIMP in BATCH mode and scripting actions to be performed on a set of images.

The second way, which is much easier and, in your case, probably sufficient is the wonderful ImageMagick suite. You can probably do everything you want using the convert tool of that suite. The following are some relevant options, you can see the whole list using man convert or by visiting this page.

NAME
      convert - convert between image formats as well as resize an image, blur, 
      crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

SYNOPSIS
       convert [input-option] input-file [output-option] output-file

-background color    background color
-crop geometry       cut out a rectangular region of the image
-trim                trim image edges
-size geometry       width and height of image
3
  • Thank you, but how do one batch that command for all files in a dir? I got it to work for one file: convert Screenshot_20200628_105148.png -crop 1360x1080+0+0 output.png
    – Torsten
    Jul 19, 2020 at 16:11
  • Got it like this: for file in *.png; do convert -crop 1360x1080+0+0 $file cropped_$file; done
    – Torsten
    Jul 19, 2020 at 16:18
  • 1
    @torsten exactly! Just one improvement: use "$file" because otherwise, it will fail on any file names with spaces.
    – terdon
    Jul 19, 2020 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.