Median stacking using G'Mic in GIMP

So I’m fairly new to using GIMP, just moved over from the Adobe suite. I’ve been having trouble converting my post processing for long exposures with median stacking to something amenable to GIMP

In the Adobe suite I would select images in LR and send these as layers to Photoshop where I would load them into a stack and convert to aligned smart objects in order to do median stacking.

Right now I’m trying to align 10 images brought into GIMP as layers. Using G’Mic, I’ve been playing around with the layer filters but haven’t found any that would align my images as well as I could with Photoshop. I tried using ALIGN IMAGES first before trying BLEND_median or BLEND_average but I would get weird ghosting patterns or I would get a bad alignment.

Any advice would be great!

I’d try using hugin or hugin’s command line tool align_image_stack. Then take them into GIMP and use GMIC.

I downloaded Hugin last night but it was giving me an error code and wouldn’t stack my TIFF files. I’ll search again from some better instructions on how to use it. Thanks.

There’s a few options around to learn if you’d like:

https://patdavid.net/2013/01/focus-stacking-macro-photos-enfuse.html#hugin-align-images

https://patdavid.net/2013/09/faking-nd-filter-for-long-exposure.html#testing-the-theory

Of course, feel free to post in this thread with any example images and questions and we can help you work through it!

3 Likes

Thanks! I was reading some of your walkthroughs on stacking last night but I think my sleepiness prevented any of it from sticking.

I’ll try again later and ask for help if I can. Thanks for the tutorials, I’m gonna definitely look through them again.

One question though: do you feel that the image stacking in G’Mic is as good as what can be done in Photoshop? I have 9 images taken on a tripod using mirror up and found that the alignment to be a bit off but felt Photoshop could’ve powered through it?

1 Like

Sure, no problem! If you get stuck just report back here with some details and we’ll get a workflow going for you in no time. :wink:

1 Like

You can do the stacking fully with Hugin with the help of hugin_stack.

create file median.executor in \Hugin\share\hugin\data and paste the following lines into it:

[General]
Description=Median of stacked images
Help=Output median image of stacked images
StepCount=2
IntermediateImageType=tif

[Step0]
Description=Remapping images
Type=remap
Arguments=-v -r ldr -m TIFF_m
Keep=0

[Step1]
Description=Calculating median
Type=merge
Input=all
Program=hugin_stacker
Result=%prefix%.tif
Arguments=--output=%result% --mode=median %input%

then stitch from hugin’s Output menu

2 Likes

@panomies do you know if that file can be places some where in the user’s home directory?

@panomies Do you have an example of how to use that median.executor?

In my folder, \ Hugin \ share \ Hugin \ data is already a file median_stack.executor whose content is the same as the one you submitted. The name is different but the content is the same. I’ve tried this median_stack.executor, but I have not had success.

It would be nice if you had more specific instructions / examples on how to get a good way to use this tool.

The process is exactly same as when stitching a panorama, but instead of using the stitch button, executor is used from the menu. I’ve had zero problems stacking with Hugin.

Only pitfall I can think of is that if you have both sky and landscape in the picture, the alignment will fail if you have control points on both.

quoting from: https://wiki.panotools.org/User_defined_output_sequence_and_user_defined_assistant:

In Hugin you can open an executor file from any directory and stitch with the settings from this file your project. Hugin 2017.1 and later lists the executor and assistant files from 2 directories in the menu bar for easier access: from a systemwide data directory and from an user data directory. On Windows the paths are install directory\share\hugin\data and c:\users\USERNAME\AppName\Roaming\hugin, on Linux the paths are /usr/share/hugin/data and ~/.hugindata.

1 Like

In the first article you provided, Align Images with Hugin, is there a step missing before clicking “Optimize Now?” When I click it, it says it can’t optimize because it doesn’t have any control points.

So still not working for me. Here’s what I did:

  1. Imported 10 TIFFs into Hugin, then tried to follow the instructions from the article “Align images with Hugin.”
  2. Hugin error; couldn’t optimize because no control points were chosen.
  3. Tried adding controls points manually one by one by clicking 0->1, 1->2, etc.
  4. Optimize worked and I followed the rest of the instructions from Pat David’s article.
  5. Hugin finished processing but said it had errors: Enfuse was having trouble stacking and that I should remove some photos.
  6. I ended up with 10 adjusted TIFF files that didn’t look aligned when I dropped them into GIMP.

I’m sure I’m missing something in Hugin where it should auto-pick control points? I can’t imagine manually putting control points when I have a lot of photos to stack.

What version of hugin are you using?

Hugin 2018.0.0

Could you upload a sample image stack?

Sure. It’ll have to be later once I get home.

Ok, I think this might be my error: I’ve been clicking on STITCH instead of using the executor from the menu to do my stack?

Step 3 in the instructions may be slightly hard to follow. You need to decide what type of Feature Matching you want to do (Align Image Stack in your case):

image

Then press the “Create control points” button to create your points automatically.

If you’re going to merge these images yourself for median stacking, then you want the output to be remapped individual files, so on the Stitcher tab choose “No exposure correction, low dynamic range”:
image

Also, for some reason, in 2018 on windows I cannot open the Optimizer tab:

image

Anyone else have this problem?

By “windows”, do you mean that it isn’t faded out in Linux? Unsure whether it is by design or a bug. Tabs appear to activate when settings warrant them. I read that somewhere in the docs. I wish there was some indication within the app for normal users like me.