Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Layering images rom different directories.

Tue Apr 27, 2021 1:02 pm

I have been scouring the web to try to find what I'm looking for, but as how I'm completely ignorant I haven't gotten anything to work.

Let me explain what I'm trying to do. I have images in two different directories. I need to layer one image on top of another image to plug holes in the alpha channels of the main image. Files in both directories have the same name so they can't be in the same directory and it will be ran on multiple files.

File "1" from directory "a" needs to be layered over file "1" from directory "b". Then file "2" from directory "a" needs to be layered over file "2" from directory "b" and so on until the files are all output correctly. The files from Directory "b" will need to be overwritten.

Is there a way to do this?

Thank you.

Re: Layering images rom different directories.

Tue Apr 27, 2021 4:14 pm

Ofnuts 'Interleave Layers' does exactly what you want.

'Open as Layers' from each directory on different canvases. That means you have Gimp in 2 different Tabs. Then open Interleave Layers from the base layer canvas. The layers have to be the same size.

Re: Layering images rom different directories.

Tue Apr 27, 2021 4:19 pm

Thank you is a way to do this in batch. I'm talking about 100s of files here.

Re: Layering images rom different directories.

Tue Apr 27, 2021 4:29 pm

Yes. I work with hundreds or thousands of files all the time. Don't need a batch script when you have a python script.

Re: Layering images rom different directories.

Tue Apr 27, 2021 4:43 pm

Ok, how do I use this to do multiple files?

Re: Layering images rom different directories.

Tue Apr 27, 2021 11:59 pm

Installing plugins and using Gimp on more than 1 canvas are different questions.

When you download any plugin (python) you must make it executable.
This particular plugin is found under 'Image > Interleave Layers'.

Open Gimp, select 'open as layers' for the files in directory 1. This is important. You don't want 900 instances of Gimp.
You only want 2 instances of Gimp with the same sized layers. These layers are the files in your 2 directories.

Re: Layering images rom different directories.

Fri Apr 30, 2021 12:16 pm

slentara1 wrote:I have been scouring the web to try to find what I'm looking for, but as how I'm completely ignorant I haven't gotten anything to work.

Let me explain what I'm trying to do. I have images in two different directories. I need to layer one image on top of another image to plug holes in the alpha channels of the main image. Files in both directories have the same name so they can't be in the same directory and it will be ran on multiple files.

File "1" from directory "a" needs to be layered over file "1" from directory "b". Then file "2" from directory "a" needs to be layered over file "2" from directory "b" and so on until the files are all output correctly. The files from Directory "b" will need to be overwritten.

Is there a way to do this?

Thank you.


You should have a look at ImageMagick, it is a (free) toolbox of image operations designed to be used from shell scripts.

Re: Layering images rom different directories.

Fri Apr 30, 2021 12:26 pm

I know of image magick but IDK how to use it
Post a reply