I am in the process of building a script to make focus stacking using focus-stack quicker and easier (ultimately, select the inputs from Geeqie and run the script as a plugin), but noticed that focus-stack does not add any of the metadata from the input files into the output file. Obviously, that would be hard for metadata that varies across the inputs, but a lot of metadata will be the same.
The script creates a temporary TIFF for each input raw file using darktable-cli and then produces a stacked TIFF from the temporary ones using focus-stack. But the stacked TIFF has no metadata in it. At a minimum, that means darktable can’t identify the camera and lens for correction purposes.
I can use Exiftool to extract metadata from the inputs, and then add selected metadata to the output stacked TIFF, but I don’t know what input metadata darktable uses for more than writing to its output file. Is there a list anywhere?
P.S. I also use RawTherapee and ART, so I would be interested in a similar list (if it exists) from those packages as well.
I have wondered for a while what the technically correct workflow is for stacking. I don’t do it much, but have a few to process lately. I always do the opposite of what you propose here, I do all my editing in darktable, try and get the image “finished” then output the tiffs to stack, and stacking is the last part of it (unless it needs to go into gimp or another pixel editor).
Interesting. I’ve been going on the assumption that editing could affect sharpness, possibly not uniformly, and that in turn could affect the processing in the focus stacking program, so I’ve tried to do as little as possible to the inputs prior to stacking. But of course, I could be totally out to lunch on that.
I have the same question regarding which order to do focus stack:
process each input image and then stack with only very little touch up, like removing stacking halos, or
Only do capture sharpening and keep everything else neutral (unchanged) and do most edits after stacking.
Currently, I am at 2.
I use align_image_stack and enfuse command line tools from Hugin. The Enfuse manual states that linear output is prefered, so I use 16-bit linear (gamma = 1) tiff:
"...As in all image fusion operations it is preferable to use 16 bit linear
(i.e. gamma = 1) images throughout, but 8 bit gamma-encoded images will do.
Naturally, high signal-to-noise (SNR) ratio input data always is welcome. ..."
Not exactly the answer you’re looking for, but when making tiff composites (HDR, collages) I just copy the full metadata from a “representative” member into the final image.
This is more or less what I find myself thinking too. To get a good stack, the aperture, shutter speed, ISO and white balance should be the same for all the input shots, so the metadata for any one should be fine for most data items.