Author Topic: Batch HDR Toning Script for Photoshop  (Read 41522 times)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #25 on: January 01, 2014, 05:22:11 PM »
It's line 182 in one of Adobe's scripts. This script makes calls to various Adobe scripts. Uncomment line 38:
Code: [Select]
//$.level = 2;
and it should break inside those Adobe scripts, so you can see what is actually going on.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Batch HDR Toning Script for Photoshop
« Reply #26 on: January 02, 2014, 02:38:52 AM »
Stops at line 172 "throw Error( kUserCanceledError );" (Didn't cancel.)
Resuming from there, it stops at 385, "app.activeDocument = tmpdoc;" (tempdoc=null)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #27 on: January 02, 2014, 04:24:30 AM »
Which file is that in? There are several Adobe scripts that get called. The call stack info might be helpful too.

Also, does it work if you merge those source files manually with 'Merge to HDR Pro...'

At the merge stage all I really do is call a function in an Adobe script and send it some filenames, pretty much the only thing my script can screw up is sending the wrong filenames.

If the problem is in an Adobe script there's not much I can do about it (which probably means it can't merge your source images for some reason). If you want to send me a small sample of the files I can try and run it myself.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Batch HDR Toning Script for Photoshop
« Reply #28 on: January 02, 2014, 07:13:55 AM »
Merge to HDR Pro works fine. Thanks for your help, but I don't think I'm going to bother with this though since Photoshop takes forever and I already have this scripted with Photomatix. (I'm also going to continue messing around with Ceronoice, which you should take a look at for an extremely fast/free solution.)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #29 on: January 02, 2014, 03:08:40 PM »
I really wrote this script to be able to use the photoshop toning tools not just the HDR merge. It's just that most ppl want to use it more for the merging ability, which does seem a little strange to me.

kirkt

  • New to the forum
  • *
  • Posts: 7
Re: Batch HDR Toning Script for Photoshop
« Reply #30 on: January 02, 2014, 04:23:02 PM »
Thanks for the script - it's a nicely implemented, automated way to consolidate HDR workflow in PS.  Is there a way to use it so that it takes advantage of the PS CC HDR toning workflow that uses the Camera Raw interface?  Like passing it an XML sidecar in place of a HDR toning preset? 

Because that's just what you need - more people asking you for free shit.

Thanks for your efforts!

kirk

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #31 on: January 02, 2014, 06:06:23 PM »
If you want to use ACR for toning, I recommend just running the script, outputting 32bit TIF, then toning the resulting TIFF sequence in Bridge. You'll have a lot more flexibility and it will be faster to do it from Bridge. I even have another script for ramping ACR settings so you could take advantage of that as well.

Here's a sequence that I did that with (since I needed to use my Bridge script to deflicker):


Each frame is a 2 shot bracket, with AETTR setting the exposure and the second shot +4EV.

I merged them using my photoshop script to 32 bit TIFF, then I deflickered and toned using my Bridge script.

engardeknave

  • Senior
  • ****
  • Posts: 341
Re: Batch HDR Toning Script for Photoshop
« Reply #32 on: January 03, 2014, 12:52:42 AM »
It makes sense to use Photoshop to merge if you want the dynamic range of a 32-bit workflow and don't have some other software to do it.

Frankly, I have yet to see any sort of automated toning that doesn't look like the work of a retarded chimpanzee--that I'm not just going to have to correct in an additional step anyway. And of all the software I've tried, Photoshop is dead worst imo.

webbwbb

  • New to the forum
  • *
  • Posts: 3
Re: Batch HDR Toning Script for Photoshop
« Reply #33 on: March 06, 2014, 06:38:23 PM »
I was trying to use this last night and ran into some problems...  I use CS5.  I need to run the deghosting off the properly exposed image.  Photoshop wants to run it off the underexposed image.  I can just change it over on Merge to HDR Pro but I don't really have any options to do that with the batch script.  Am I missing something?  I have some coding experience and have poked around in your batch file and in Adobe's script file but haven't found anything that seemed to handle it.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #34 on: March 06, 2014, 10:23:15 PM »
in Merge To HDR.jsx (the Adobe script):
Code: [Select]
// Set to the deghosting base image index, or to kMergeToHDRDeghostOff or kMergeToHDRDeghostBest
mergeToHDR.deghostSetting = null;

so in my code you'd need to change line 118:
Code: [Select]
mergeToHDR.mergeFilesToHDR( currentFileList, mergeToHDR.useAlignment, hdrDeghosting ? kMergeToHDRDeghostBest : kMergeToHDRDeghostOff);

I guess when you use kMergeToHDRDeghostBest Photoshop automatically tries to determine the 'best' (whatever that means) image and does the deghost of off that one.

webbwbb

  • New to the forum
  • *
  • Posts: 3
Re: Batch HDR Toning Script for Photoshop
« Reply #35 on: March 06, 2014, 11:58:46 PM »
I played around with that line in the Adobe one just hoping to get it to use the file I wanted but no values seemed to change behavior; no matter what was entered, the functionality stayed the same.  I restarted Photoshop between edits of that file.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #36 on: March 07, 2014, 01:03:50 AM »
don't mess with the adobe script, change the call to mergeToHDR.mergeFilesToHDR (the third parameter) in my script (the function call is going to overwrite deghostSetting when it runs)

webbwbb

  • New to the forum
  • *
  • Posts: 3
Re: Batch HDR Toning Script for Photoshop
« Reply #37 on: March 07, 2014, 01:32:26 AM »
That worked, thank you!

concept2form

  • Just arrived
  • *
  • Posts: 1
Re: Batch HDR Toning Script for Photoshop
« Reply #38 on: March 07, 2014, 07:41:24 PM »
Just wanted to drop by and let you know that I used your script last night on a very large amount of files, and it went off perfectly!!! That being said, and of all the scripts I've used to automate PS in the past are belittled by the genius of this script. ADOBE SHOULD GIVE YOU SOME MONEY!! If I wasn't so broke, I'd give you money!

Good on ya for this one!!! Saved me countless hours of, selecting brackets, going to tools menu drop-down, selecting command, waiting, saving, repeating....

I hope you end up getting kickbacks for this and that Adobe doesn't undercut you and add this feature to any future releases of PS/Bridge. You deserve it! Thanks again!

If you'd like to build this into a plug-in, I could help you there.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #39 on: March 07, 2014, 09:36:07 PM »
thanks ;)

photo360

  • New to the forum
  • *
  • Posts: 5
Re: Batch HDR Toning Script for Photoshop
« Reply #40 on: March 27, 2014, 08:49:36 AM »
Hi,
Thank you very much for your script.
I try to use it on CS6 (64bits or 32bits on windows 7) and i have always the same problem: the image files are not merged in the order of the filename.
If i have a directory with the sequence: file1.jpg, file2.jpg, file3.jpg, file4.jpg, file5.jpg, file6.jpg and try to merge it by a number of brackets = 3, the script merge the files like this (file2.jpg, file6.jpg, file5.jpg) and (file1.jpg, file3.jpg, file4.jpg) wich is not right and souhd be (file1.jpg, file2.jpg, file3.jpg) and (file4.jpg, file5.jpg, file6.jpg).
I should precise one important thing: it works fine if the directory is stored on local drive (for example c:) but it bugs when files are on a distant server (synology DS1010+).

Thanks for your help

photo360

  • New to the forum
  • *
  • Posts: 5
Re: Batch HDR Toning Script for Photoshop
« Reply #41 on: March 27, 2014, 09:49:59 AM »
Ok. i finaly found a solution.

i have add this line in the code, just under "var files =  sourceFolder.getFiles(fileMask);"
 "files.sort();"

Hope this can help somebody.

Best regards,

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #42 on: March 27, 2014, 11:42:18 AM »
thanks, I'll add it to the script

kanoneno

  • Just arrived
  • *
  • Posts: 2
Re: Batch HDR Toning Script for Photoshop
« Reply #43 on: April 15, 2014, 10:07:38 PM »
Hi there,

I'm trying to batch process a set of HDR files and I got into this thread.

I tried to use the BatchHDR Script but I get an error, does anybody know what can I do to fix this?

Error 60: Not well-formed (invalid token)
Line 1296

I would really appreciate If I could use this script, it will save tons of time

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #44 on: April 15, 2014, 11:06:42 PM »
I can only assume that the error is occurring in one of the built-in adobe scripts, as this script doesn't have 1296 lines.

I can't help you unless you can give me more information about the error. When exactly does it occur? What version of Photoshop? Mac/Win? What are your settings? Can you successfully manually merge a set of the images?

kanoneno

  • Just arrived
  • *
  • Posts: 2
Re: Batch HDR Toning Script for Photoshop
« Reply #45 on: April 16, 2014, 07:12:00 AM »
Thanks for replying,

I'm working on Photoshop CC 64bit on a windows computer, the issue goes like this:

When I open Photoshop I go into the scripts menu, thats where the program recognizes the Batch HDR script, for some reason it doesn't place it under the Automate submenu, and when I try to run the script the error code appears.

I'm trying to attach a image of the error but can't find an attachment button that works





dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #46 on: April 16, 2014, 03:03:53 PM »
It sounds like the script is probably failing trying to load the built in Adobe scripts. Could be something to do with windows 8 or 64 bit directory paths weirdness.  I don't have a windows pc, so I can't really help you much, other than to guide you on how to fix the problem yourself. You can download the ExtendScript Toolkit from Adobe and try stepping through the script in debug mode. You'll want to uncomment line 38. Click on the line numbers on the left side to set a breakpoint on a particular line (the script will pause there until you hit the continue button). If the script fails you should be able to see exactly where it failed (in what file), it should automatically pause and highlight the line orange. The stacktrace (middle right side of window) will tell you where in my script it is currently executing, if it has failed in a different file.

If that is too technical for you then you could try asking in the Adobe photoshop scripting forum. Someone there with a windows box might be able to determine what is going on with the script. Or I can ask over there if you'd like.

I'm trying to attach a image of the error but can't find an attachment button that works
There is no way to do attachments, you have to upload the image to some public file sharing like dropbox, imgur, etc. and put the link in an img tag

efex83

  • Just arrived
  • *
  • Posts: 1
Re: Batch HDR Toning Script for Photoshop
« Reply #47 on: May 01, 2014, 12:44:56 PM »
thanks for this great piece of code.

im having a problem using the preview function, when i try to open files the dropdown menu for the filetype says
"FUNCTION (){RETURN TRUE;} (function (){return true;})"

unsurprisingly there are no files of this filetype, so i cant pick any

Win7 64; CS6 64

grateful for any pointers

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3212
  • 60Da / 1100D / EOSM
Re: Batch HDR Toning Script for Photoshop
« Reply #48 on: May 01, 2014, 10:40:58 PM »
Not sure how that happened but I guess I never noticed as I'm on a mac and it seems the filer argument is ignored. It should be fixed now, but I have no way to test it.

tibungla

  • Just arrived
  • *
  • Posts: 2
Re: Batch HDR Toning Script for Photoshop
« Reply #49 on: May 15, 2014, 12:37:43 AM »
First let me say thanks! Thanks for writing this, sharing it, and helping those of us who don't know how to code.

I love the script and want to make 2 tweaks to it.

1. I want to Deghost using the underexposed image. How can I set that instead of the "Best" image?
2. I want to set the  White Point Preview to the darkest option possible, all the way to the right on the slider in the HDR dialog box. Is there a way to set this?

Thanks in advance!