Scripting Merge to HDR

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

jako

Scripting Merge to HDR

Post by jako »

Hello All,

I'm trying to properly script Merge to HDR. I've already gotten to the point where I can batch merge to hdr, however, I'm unable to get the results I want about 30% of the time.

I'm basically trying to Merge to HDR, get a 32 bit file, and hopefully have the right response curve loaded. I've gotten the first two things down, but I cannot seem to consistently get the right response curve (at least from what I can tell).

Here's an example of the script:
Code: Select allvar runMergeToHDRFromScript = true;// define and set to true before including Merge To HDR.jsx
var g_ScriptFolderPath = app.path + "/"+ localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts");
var g_ScriptPath = File( g_ScriptFolderPath+'/Merge To HDR.jsx');
$.evalFile( g_ScriptPath );


mergeToHDR.useAlignment = false;
mergeToHDR.outputBitDepth = 32;

var filelist = [File('IMG_2442.CR2'), File('IMG_2442\ copy.CR2')];
mergeToHDR.mergeFilesToHDR( filelist, false, 0);
app.activeDocument.saveAs (File("/Users/JJK/Desktop/photos\ to\ process/falloff\ just\ in\ case/badphoto/HDR_2442"));
var idsave = charIDToTypeID( "save" );
        var desc4 = new ActionDescriptor();
        var idAs = charIDToTypeID( "As  " );
        desc4.putString( idAs, "Radiance" );
        var idIn = charIDToTypeID( "In  " );
        desc4.putPath( idIn, new File( "/Users/JJK/Desktop/photos\ to\ process/falloff\ just\ in\ case/badphoto/" ) );
        var idLwCs = charIDToTypeID( "LwCs" );
        desc4.putBoolean( idLwCs, true );
executeAction( idsave, desc4, DialogModes.NO );

app.activeDocument.save();
app.activeDocument.close();


In the automated Merge to HDR GUI, there's a part where you're supposed to load the response curve for the camera and I want the response curve to be 0 0 1 (so that when I merge the pictures are linear). I've gone into Merge To HDR.jsx and changed the following:
Code: Select all   
try {
      desc = app.getCustomOptions( kMergeToHDRCameraCurve + cameraID );
      this.fCameraCurveDesc = null; //desc.getList( kMergeToHDRUIResponseCurve);
   }
   catch (e)
   {
   }


I changed desc.getList() to null. This makes the success rate go up, however, I am still unable to get the right picture. Can someone help me make photoshop produce the right image 100% of the time? Let me know if I need to be more specific.

Thanks!