Stackin' & Stitchin' - how much to do in raw editor beforehand

Thanks to a recent workshop I went on, I suddenly have a lot of focus stacks and panoramas to process. I’ve successfully used focus-stack before, and I gave Hugin a first try the other night for a pano.

In both cases, I’ve used darktable-cli to do the initial processing of the input raw files, and exporting the intermediate files under /tmp as TIFF to avoid loss of information. Then I am stacking with focus-stack or stitching with Hugin, as the case may be, to an output TIFF file. Finally, I’m editing that final TIFF in darktable with output to a JPG.

I’m aiming to fine tune what steps get done in the darktable-cli executions and what steps are left to the final darktable edit. I’m thinking that anything that corrects the input based on characteristics of the camera or lens, e.g., chromatic aberrations and lens correction, would likely result in better alignment of images. The processing-intensive stuff like diffuse or sharpen, as well as (obviously) any local edits, is probably best left to be done once in the edit of the final TIFF.

First off, am I out to lunch on any of the above?

If what I’m doing passes the sniff test, then:

  1. Beyond the non-optional steps, plus chromatic aberrations and lens correction, are there additional things that are best done in darktable-cli before the stacking or stitching?
  2. The stacked TIFF file coming out of focus-stack has very little EXIF data, representing only what focus-stack did itself. Would you use Exiftool (or exiv2) to add EXIF data from one of the input raw files into that TIFF, or just edit the bare data?
  3. For heavy users of presets, I expect that it would be beneficial to at least have camera model and maker, lens, ISO, exposure, aperture, focal length in order to properly select presets. Correct?

Once I’m happy with the process, I’m intending to make a plugin for Geeqie so that I can just select files, right click, and stack 'em. If there’s any interest in that, I’ll share it.

I usually edit as much as possible in darktable before hand, sans uses of masking. Then I copy that edit to all the images in the sequence, then export. Then stack or stitch, then do any local edits, generally in GIMP, then export the final.

I think what you’re doing is good, as long as you’re getting the results you want.

But I’m by no means an expert.

Always.

1 Like

Your processing steps seem very logical to me. I do something similar as I shoot a lot of panorama stitched images. However, one observation I have made is that sometimes lens correction being applied to images helps and other times it hinders the stitching process. I am presuming this is more about if images have lots of straight lines which have been distorted by the lens or if it is an image such as a landscape without many buildings. I consider generous overlap is also important for this issue as distortions tend to be worse near the edges of the longer side of the image than in the centre portion. I am using Microsoft ICE for my compositing but I presume Hugin may experience the same issue at times with distortions and lens correction.

BTW, what program do you use for focus stacking and do you stack RAW files in that program? I am trying to find a FOSS option for focus stacking of my RAW files from various cameras.

1 Like

It’s simply named focus-stack, and runs from the command line. It doesn’t stack raw files, which is why I am running darktable-cli to create TIFFs for input to focus-stack.

I haven’t been applying lens correction with my darktable-cli invocations so far, and have had decent results as far as I can tell. I was thinking that doing so would be helpful in case there is any barrel or pincushion distortion, for example, but that’s a just a thought, not tested by me.

Interesting…so what type of files are you exporting to be inputs to stacking? JPG, TIFF, …?

16-bit TIFF

1 Like

Likewise.

I export 16 bit png files in adobe rgb profile for panorama stitching. I selected PNG files so they are easy to find in the folder of images. I could have used tiff files but they would be harder for me to locate as I export all my finished exports from DT as tiff files.

I use 16 bit files to ensure I get the ‘best’ file for further editing of the stitched panorama. I use adobe rgb because I believe it has a larger color gamut to possibly help give me the best file for editing the stitched image. I am happy to be corrected by wiser people.

1 Like

Same here, I think it depends heavily on the scene, the overlap and the lens quality. Some newer cheap lenses, such as the RF-S ones depend strongly on lens correction and in this case I apply at least distortion and vignetting correction before stitching. Otherwise you will need 40-50% overlap.

1 Like