Fusion with Enfuse – making a simple batch script for Linux

Altough recently published, my article about photography software for Linux was started 2 – 3 weeks ago.
One of the writings was about Exposure Blending, a Kipi plugin that failed to work in my Xubuntu.
Because blending images is something I often do, I needed a solution soon.
Before on Windows, I developed a batch file named ESF Enfuse Simple Fusion,
a command line script that worked with Enfuse.
Enfuse is also a part of Hugin, and I already installed that.
So, the only thing I needed is a Linux version of my old ESF script.

If you want to do the same, you first need to know if Enfuse is installed and, you can get in running thru Terminal command.
To do this first open a Terminal ( right click on any screen – choose start terminal here ) type : enfuse –help
(Update : in some cases you need to start with ./ before the “Enfuse” command, so it would be : ./enfuse –help )  You should get this response :

1enfusetesthelp

If not, you need to install Enfuse – or Hugin – first.

Next I went to my home folder, created a new document ( right click – create document – empty file ) and named it “Enfuse-Test” , save the file with the extension sh, but it isn’t mandatory.

I also copied two image files in my home folder for testing ( files need to be of the same size, best is a picture developed in two different ways )
Then open the file ( with text editor ) and start the first line with :

#!/bin/bash 

then write your first command line for testing :

enfuse -o /home/pentaxianbelgium/output.jpg /home/pentaxianbelgium/testimage1.jpg /home/pentaxianbelgium/testimage2.jpg

this is : the name of the program “enfuse” – space – followed by -ospace– path to outputfile “/home/pentaxianbelgium/output.jpg“-space – path to input files “/home/pentaxianbelgium/testimage1.jpgspace– /home/pentaxianbelgium/testimage2.jpg

Save the file.

2enfusescript

Now, in your Home folder ( where the new script is and the test images ) start a Terminal and type :

chmod +x ./Enfuse-Test

otherwise the script won’t run

3enfusechmod

Then, in the same ( or a new ) Terminal console type :

./Enfuse-Test

The script will start running ( maybe a few warning messages, just ignore them 🙂 ) , an output.jpg file will be created, wait until the script is finished before opening the new Fused image.

4firstfusion

If you want slightly more information output, you could add the -v ( verbose ) option at the beginning :

enfuse -v -o /home/pentaxianbelgium/output.jpg /home/pentaxianbelgium/testimage1.jpg /home/pentaxianbelgium/testimage2.jpg

7verboseterminal

et voilà , a new Fusion :

output

Originals :

testimage1

testimage2

If you want to use the same images as I did in the test, you can download them @ Flickr here :

https://www.flickr.com/photos/133732885@N08/

 

2 Comments

  1. Writting scripts is great fun, but what about Macrofusion?

    https://github.com/salvadhor/macrofusion

    • Yes, from what I have read just now, its promising,
      have to check this one out soon !
      thanks dhor !

Comments are closed