Post Reply 

Command line for exposure blend

Dec 22, 2012, 01:48 (This post was last modified: Dec 22, 2012 01:49 by pannayar.)
Post: #1
Command line for exposure blend
New gimp user here. I have been using the exposure blend plugin and have been getting good results. However when I have 5 or 7 bracketed shots , there is a bit of trying various combinations of the dark and bright exposures to get the most pleasing one eventually. This is getting a bit cumbersome. Is there a command line to do the same thing (and save the output as a jpeg) so I can run a bunch of commands and just look at all the outputs. That would make life a lot simpler. Thanks a lot!
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 11:26
Post: #2
RE: Command line for exposure blend
Have been trying various searches to see if I can find something. No luck.

I don't know if I need a new script. I think I need to come up with the correct way of calling (from the shell command prompt) the exposure-blend* scm files (in the gimp scripts folder) with the right parameters passed to it...

Any help will be highly appreciated. Thanks.
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 12:13 (This post was last modified: Dec 23, 2012 02:22 by pannayar.)
Post: #3
RE: Command line for exposure blend
I did not quite follow your math. Let me explain a bit of my situation.

We use (in the exposure blend plugin's GUI mode) 3 shots - a normal (N), dark (D) and bright (B) shot. I take 5 shots, call them D2, D1, N, B1, B2 (at -2, -1, 0, +1, +2 EV). In a simple case, I want to try the results with these 4 combinations.

[D2, N, B2]
[D1, N, B1]
[D2, N, B1]
[D1, N, B2]

And possibly others like [D2, D1, N] in the 5 shot case. These combinations grow to may be around 10 or so with 7 shots. Not to 2^7 or 3^7 or such huge numbers.

Now when I have 7 shots, I visually try to judge which selection of the [D, N, B] from the 7 might give me a good result. Instead if I can just batch it all and see all the outputs, that will make the work much less repetitive and less cumbersome (if I have say 5 or 7 shots each for 20 different pics...)

Thanks!
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 12:34
Post: #4
RE: Command line for exposure blend
More reading tells me something along these lines is what I need.

gimp -i -b '(script-fu-exposure-blend img_normal img_dark img_bright ... )' ...

If someone can help me with filling in the "..." portions in the above line, I think I will be getting closer to what I need.

Thanks
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 14:31 (This post was last modified: Dec 22, 2012 14:55 by pannayar.)
Post: #5
RE: Command line for exposure blend
(Dec 22, 2012 14:22)ofnuts Wrote:  It's a bit more complicated than this because I don't see the plugin saving the file so you have to write a small script to call the exposure blend and save the result.

Yes. In the GUI mode, I export the output to a JPEG which is a independent process I guess. Can someone help me there?

As of now, I am having trouble even passing the correct parameters to the blend.scm ... (after cd -ing into the folder than contain the images N/D/B.jpg).

gimp-2.8.exe -i -b '(script-fu-exposure-blend img_f ... )'

What parameters need to be passed for img_f, img_dark_f etc?

Here is a error screenshot.

Thanks


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 21:26 (This post was last modified: Dec 22, 2012 21:28 by pannayar.)
Post: #6
RE: Command line for exposure blend
Thanks a lot for the help folks.

Yes this is the plugin I am working with. http://registry.gimp.org/node/6708

I thought the parameters were just file names, but did not use double quotes.

Now, I have these 3 in a folder, and I did.

$ ls
B.jpg D.jpg N.jpg

$ gimp-2.8.exe -i -b "(script-fu-exposure-blend \"N.jpg\" \"D.jpg\" \"B.jpg\")" -b "(gimp-quit 0)"

I thought the other parameters (blur-rad, blur-thresh etc) will be defaulted but it seems like all of them (as in this gui) need to be passed. I don't know what values to pass for some - "TRUE" / "FALSE" for the 'Dark Takes Precedence' ... ?


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
Dec 22, 2012, 23:30
Post: #7
RE: Command line for exposure blend
I at least found the parameters now.

gimp-2.8.exe -i -b "(script-fu-exposure-blend \"N.jpg\" \"D.jpg\" \"B.jpg\" 8 "Gaussian/None" "Dark" "Bright \(inverted\)" FALSE FALSE)" -b "(gimp-quit 0)"

Do we have to do the -b "(gimp-quit 0)"
I mean, if there are 100s of files to be processed ,would it be better to not close it and reopen it each time.


-----
batch command executed successfully...

GIMP-Error: Calling error for procedure 'gimp-image-get-active-layer':
Procedure 'gimp-image-get-active-layer' has been called with an invalid ID for a
rgument 'image'. Most likely a plug-in is trying to work on an image that doesn'
t exist any longer.

script-fu.exe-Warning: Error while loading C:\Program Files\GIMP 2\share\gimp\2.
0\scripts\exposure-blend-1.3c.scm:

Error: (C:\Program Files\GIMP 2\share\gimp\2.0\scripts\exposure-blend-1.3c.scm :
627) Procedure execution of gimp-image-get-active-layer failed on invalid input
arguments: Procedure 'gimp-image-get-active-layer' has been called with an inva
lid ID for argument 'image'. Most likely a plug-in is trying to work on an image
that doesn't exist any longer.
Find all posts by this user
Quote this message in a reply
Dec 23, 2012, 02:13
Post: #8
RE: Command line for exposure blend
(Dec 23, 2012 01:07)ofnuts Wrote:  Me things the parameters there are more like:
Code:
\"N.jpg\" \"D.jpg\" \"B.jpg\" 8 0 0 0 FALSE FALSE"

That gave me an error saying 'not enough arguments'.

(Dec 23, 2012 01:07)ofnuts Wrote:  Excellent remark... it's better to write a script that would just take a directory, and iterate in the files in it, calling the plugin and saving the result.

You can write the scripts in Python, a language with which can you can be more familiar already (or with which you'll get familiar a lot faster).

I am a little familiar with perl. Not python. If someone can help me with the rest of the remaining steps, it would be great.

Thanks.
Find all posts by this user
Quote this message in a reply
Dec 23, 2012, 17:30
Post: #9
RE: Command line for exposure blend
Ok, please take a look at it when you get a chance. Thank you very much.
Find all posts by this user
Quote this message in a reply
Dec 27, 2012, 01:42
Post: #10
RE: Command line for exposure blend
Any help or guidance on this will be highly appreciated. Thanks!
Find all posts by this user
Quote this message in a reply
Dec 30, 2012, 17:24
Post: #11
RE: Command line for exposure blend
I have 3 files n.jpg d.jpg b.jpg as inputs and want a file o.jpg as the output. I leave the other parameters at the default values (see the attached gui screen shot). So we need something like this:

script n.jpg d.jpg b.jpg o.jpg

When we export the blended output to a jpeg, it asks what quality level and I leave it at the default (usually around 90/95 which is the quality of the inputs).

Thanks!


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Jan 6, 2013, 11:55
Post: #12
RE: Command line for exposure blend
(Dec 30, 2012 15:31)paynekj Wrote:  I've knocked together a basic script as proof of concept, but I need a more definitive set of requirements at this point.

What do you want to happen?
What inputs are you going to supply? i.e. file names, parameters etc
What do you expect to come out the other end? - images with particular names?

I'll also say that the original script needs modification as it generates errors, so I'm inclined to strip out the parts that are needed (maintaining the acknowledgements for the original authors) and create a separate script.

Kevin

Kevin, anything that worked? Thanks!
Find all posts by this user
Quote this message in a reply
Jan 7, 2013, 10:21
Post: #13
RE: Command line for exposure blend
(Jan 7, 2013 10:08)paynekj Wrote:  I've found that the original script has superfluous code that is causing errors and needs one line changing to make it work in batch mode. I'll try and do that later today and post back here with a new script file that will incorporate the code to run it in batch mode.

Kevin

Ok, thank you very much! Knowing that there has to be a better [batch/automated] way of doing things (in this case), it feels painful when I try all the combinations manually. Like searching all strings in a file and replacing it one by one w/o access to the global search and replace command Smile
Find all posts by this user
Quote this message in a reply
Jan 7, 2013, 22:12 (This post was last modified: Jan 8, 2013 07:39 by pannayar.)
Post: #14
RE: Command line for exposure blend
EDIT: Ignore this message. The issue was something weird on my side going on with me copying the new script (I think Win7 asking Admin rights when you copy it to some special places...).

Thank you very much. I tried it and am running into some error(s). Btw I have gimp 2.8 (you have 2.6). I suppose that should not matter.

Here is what I did.
1) Remove exposure-blend-1.3c.scm, exposure-blend-tinyscheme.scm from the share/gimp/2.0/scripts/ folder.
2) Copy your exposure-blend-1.4.scm to the same folder.
3) cd to the folder containing the 3 images, and ran this command
...
Find all posts by this user
Quote this message in a reply
Jan 7, 2013, 22:26 (This post was last modified: Jan 8, 2013 07:39 by pannayar.)
Post: #15
RE: Command line for exposure blend
EDIT: Ignore this message.
I tried calling script-fu-kp24_make_blended_image and the error is similar.
...
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to close gimp with batch command? flixe 1 547 Jun 19, 2017 12:29
Last Post: ythgilb
  Need help in running a gui script-fu via command line eyalzek 1 520 Oct 4, 2014 14:05
Last Post: eyalzek
  script-fu ok in gimp, not in commad line dominique 1 555 Sep 28, 2014 03:18
Last Post: dominique
  how to use the smudge tool in command line or script ? mygost 14 2,074 Mar 6, 2014 16:45
Last Post: mygost
  Bash command line to open two images into GIMP layers lwhistler 1 1,447 Sep 23, 2013 08:18
Last Post: rich2005

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS