PetteriAimonen / focus-stack

Fast and easy focus stacking
MIT License
294 stars 43 forks source link

Nemo Action, plus couple questions #40

Open neocogent opened 1 year ago

neocogent commented 1 year ago

Just found focus-stack and on my first tries I'm quite impressed.

I created a Nemo action - pasted below. This is a small config file let's you run focus-stack in Nemo (file manager in some linux distros like Mint) by selecting images and right clicking and choosing "Focus Stack Images" in context menu. Just an easy beginner friendly way to use this great software.

A terminal will pop up for monitoring the progress and it goes away when done.

You're welcome to add to your repo here as helper for noob users.

Questions:

Does focus-stack only work with JPGs? It would be really nice if a non-lossy format was also supported. I didn't see anything about that in my browsing here.

When I tried to run with wildcard (*.jpg) as arg (on linux) it didn't work. Just spit out help. Is this not supported on linux? This action was my way of getting around having to enter all the filenames manually.

Is there a gallery anywhere for user photos generated by focus-stack? eg. flickr page etc

Has anyone created a lua script for Darktable? That would be mighty handy and if no one has I may try figuring it out. I'm not sure if Darktable has plugins but it would crazy awesome if this tool could be built as a plugin for it.

Anyway, for now I find this method totally easier than most other ways of doing this process. Thank you for creating this program!


Paste the code below in a file called focus-stack.nemo_action in ~/.local/share/nemo/actions

[Nemo Action]

Name=Focus Stack Images
Comment=Apply focus-stack to selected images
Exec=focus-stack --output=%P/output.tif %F
Icon-Name=camera-photo
Selection=m
Extensions=jpg;tif;png;
EscapeSpaces=true
Terminal=true
PetteriAimonen commented 1 year ago

Wildcards on Linux should be parsed by shell, so focus-stack will receive just a list of filenames (that's the way it usually works on Linux).

Any image format supported by OpenCV (at least PNG and TIFF) is supported for input. The output format is determined by file extension, you can use e.g. --output=output.png.

neocogent commented 1 year ago

Oh, I wonder why that didn't work. Perhaps something to do with it being an AppImage (that's the release I downloaded)? I had a directory with 11 images and then moved there and simply did focus-stack *.jpg and it just showed me help info. Then I tried with manually typing names and that did work. Weird.

Thank you for info about filetypes. I saw that for output image but didn't know it also worked for inputs. Great stuff. I'm generally using Darktable. So if I export TIFFs and then re-import same then I guess there will be a little bit less degradation.

Also, I can add those types to the Nemo action so it is available when those types are selected.

I was just reading the lua docs for Darktable and it seems quite feasible to integrate right in with a script which will export selected images, run focus-stack and then re-import the result. I may adapt an existing script to work this way as they have some for hugin and HDRMerge.

I updated the nemo action above.

Thanks!