Batch HDR Toning Script for Photoshop

Started by dmilligan, August 15, 2013, 02:47:54 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dmilligan

It's line 182 in one of Adobe's scripts. This script makes calls to various Adobe scripts. Uncomment line 38:

//$.level = 2;

and it should break inside those Adobe scripts, so you can see what is actually going on.

engardeknave

Stops at line 172 "throw Error( kUserCanceledError );" (Didn't cancel.)
Resuming from there, it stops at 385, "app.activeDocument = tmpdoc;" (tempdoc=null)

dmilligan

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

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

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

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

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

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

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

in Merge To HDR.jsx (the Adobe script):

// 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:

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

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

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


concept2form

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


photo360

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

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


kanoneno

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

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

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

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.

Quote from: kanoneno on April 16, 2014, 07:12:00 AM
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

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

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

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!