Fauxtoto
Established Forum Member
Quebec, Canada
Posts: 440
Open to constructive criticism of photos: Yes
|
Post by Fauxtoto on May 27, 2019 13:27:42 GMT
[...] and once wrote simple BASIC programs (one to generate names for our new dog [...]) Incredible, the time we save with computers!
|
|
|
Post by Bailey on May 27, 2019 21:46:43 GMT
Bailey, Technical computer stuff is not, at all, my cup of tea. For this reason, I will continue to use the PSE program as is. However, it seems to me that the topic you are raising with your scripts is original, relevant and interesting. Thank you for sharing. No problem Fauxtoto Just to clarify in case anyone is unsure, you do not need to know anything at all about Java script or programming to run these scripts just like you don't need to understand at all what is going on in the background when you run someone else"s action. To run a script all you need to do is open the script file via File - > Open in PSE as I described in my OP. If the output of the script is not something useful to you, then all you need to do is delete the script file from your computer.
|
|
|
Post by Bailey on May 28, 2019 4:57:00 GMT
** Enhance Image Details **This script enhances the details in an image using the technique originally developed by Calvin Hollywood, named " Freaky Details". This script is based on the steps described in the above link. The main difference is that at step 8 I delete the layer instead of just turning off its visibility. I also don't add a mask as described in the last step. I manually set the opacity of the layer to 0% after the script completes and gradually increase it until I get the level of detail enhancement I like. The Unsharp Mask is still my main method to sharpen images, but on the rare occasions ir doesn't give me the result I am after, I use this script to see if I can get better results. The script will ask you if you want to run it on just the active image in the Photo Bin or on all of them in one go. do { //prompt the user if they want to process all the opened files or just the active file var strAns = prompt('Apply to all images in your'+"\r\n"+'Photo Bin or just the Active Image? (Enter - ALL or ACTIVE)','ACTIVE'); if(strAns === null){ break; } else{ strAns = strAns.toLowerCase(); //convert string to lower case strAns = strAns.replace(/^\s+|\s+$/gm,''); //remove leading and trailing spaces in string } } while(strAns !== 'active' && strAns !== 'all'); if(strAns !== null){ //user entered ALL or ACTIVE var numDocs2Process = 0; //set number of documents to process if(strAns === 'all'){ numDocs2Process = app.documents.length; }else{ numDocs2Process = 1; } for(var i=0;i<numDocs2Process;i++){ //loop through the documents to process if(numDocs2Process === 1){ //set the active document for this iteration thru the loop i = numDocs2Process; }else{ app.activeDocument = app.documents[i]; } currDoc = app.activeDocument; currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer var numOrigLayers = currDoc.artLayers.length; //store the original number of layers in the file if(currDoc.artLayers.length > 1){ stampVisibleLayers(); } currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer if(numOrigLayers != 1){ currDoc.activeLayer.name = "Merged Original"; //name the layer "Merged Original" } currDoc.activeLayer = currDoc.activeLayer.duplicate(); //duplicate "Merged" layer and make it active layer (Layer 1) currDoc.activeLayer.name = "Detail Processing"; //name the duplicated "Merged" layer "Detail processing" currDoc.activeLayer.blendMode = BlendMode.VIVIDLIGHT; //set blend mode to vivid light currDoc.activeLayer.invert(); //invert the "Detail Processing" layer surfaceBlurLayer(); //apply surface blur - radius 30, threshold 30 stampVisibleLayers(); //merge/stamp the visible layers currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer currDoc.activeLayer.name = "Enhanced Details"; //name the layer "Enhanced Details" currDoc.activeLayer.blendMode = BlendMode.SOFTLIGHT; //set blend mode of "Merged with Detail processing" to soft light currDoc.artLayers.getByName('Detail Processing').remove(); //delete layer "Detail Processing" } }
//============================================== function surfaceBlurLayer(){ var idsurfaceBlur = stringIDToTypeID( "surfaceBlur" ); var desc13 = new ActionDescriptor(); var idRds = charIDToTypeID( "Rds " ); var idPxl = charIDToTypeID( "#Pxl" ); desc13.putUnitDouble( idRds, idPxl, 30.000000 ); var idThsh = charIDToTypeID( "Thsh" ); desc13.putInteger( idThsh, 30 ); executeAction( idsurfaceBlur, desc13, DialogModes.NO ); } function stampVisibleLayers(){ var idMrgV = charIDToTypeID( "MrgV" ); var desc37 = new ActionDescriptor(); var idDplc = charIDToTypeID( "Dplc" ); desc37.putBoolean( idDplc, true ); executeAction( idMrgV, desc37, DialogModes.NO ); }
If you would like the PSE Surface Blur dialog box to pop up at the appropriate stage of the script so you can adjust the Radius and Threshold settings, in the surfaceBlurLayer() function change the last line from executeAction( idsurfaceBlur, desc13, DialogModes.NO ); to executeAction( idsurfaceBlur, desc13, DialogModes.ALL ); AND if you prefer to turn off the visibility of the "Detail Processing" layer (as described in the above link) instead of deleting it then simply change the line currDoc.artLayers.getByName('Detail Processing').remove(); //delete layer "Detail Processing" to currDoc.artLayers.getByName('Detail Processing').visible = false;
|
|
|
Post by Bailey on May 28, 2019 8:27:13 GMT
** Create Dodge & Burn Non-Destructive Layer ** This script will create a new layer filled with 50% grey and overlay blend mode to dodge and burn non-destructively.
The script will - 1. Allow the user to add the dodge & burn layer to just the current active document in the photo bin or to all of them. 2. Add the dodge & burn layer at the top of the layer stack of each document. 3. Fill the dodge & burn layer with 50% grey and set its blend mode to overlay 4. Enable the "Create layer" button when one of the radio buttons is selected. 5. Select the Brush Tool.
/*--------------------------------------------------------------- Create the dialog box ---------------------------------------------------------------*/ var dlg = new Window( "dialog", "Create Layer for Dodge & Burn" ); dlg.size = [ 400, 250 ]; dlg.resizeable = true; var pnlRadBtns = dlg.add('panel', undefined, 'Create layer for Active or Opened Documents'); pnlRadBtns.margins = [40,30,0,15]; pnlRadBtns.orientation = 'column' pnlRadBtns.alignChildren = ['left','']; var radActiveDoc = pnlRadBtns.add('radiobutton',undefined,'Active document'); var radAllDocs = pnlRadBtns.add('radiobutton',undefined,'All documents in photo bin'); var pnlSubmitBtns = dlg.add('panel', undefined, ''); pnlSubmitBtns.orientation = 'row'; pnlSubmitBtns.alignChildren = ['','top']; pnlSubmitBtns.cancelBtn = pnlSubmitBtns.add('button', undefined, 'Cancel',{name:'cancel'}); pnlSubmitBtns.submitBtn = pnlSubmitBtns.add('button', undefined, 'Create layer',{name:'ok'}); pnlSubmitBtns.submitBtn.enabled = false; // **** add event handlers **** pnlSubmitBtns.submitBtn.addEventListener('click',runSubmit); pnlSubmitBtns.cancelBtn.addEventListener('click',cancelScript); for(i=0;i<pnlRadBtns.children.length;i++){ pnlRadBtns.children[i].onClick = function(){pnlSubmitBtns.submitBtn.enabled = true;}; } dlg.show(); //======================================================== function runSubmit (){ var selRadBtnIdx = whichRadBtnClicked(pnlRadBtns.children); var numOpenDocs = app.documents.length; for(i=0;i<numOpenDocs;i++){ if(selRadBtnIdx === 0){ //process only current active document i=numOpenDocs; }else{ //loop through all documents in the photo bin app.activeDocument = app.documents[i]; } app.activeDocument.activeLayer = app.activeDocument.artLayers[0]; //set the top layer in stack as active layer app.activeDocument.artLayers.add(); //add blank layer app.activeDocument.activeLayer = app.activeDocument.artLayers[0]; //set the new layer as active layer fillLayer50pcGrey(app.activeDocument.activeLayer); app.activeDocument.activeLayer.blendMode = BlendMode.OVERLAY; app.activeDocument.activeLayer.name = 'Dodge and Burn'; } selectBrushTool(); dlg.close(); } function cancelScript(){ dlg.close(); exit(); } function fillLayer50pcGrey(layerO){ var idFl = charIDToTypeID( "Fl " ); var desc7 = new ActionDescriptor(); var idUsng = charIDToTypeID( "Usng" ); var idFlCn = charIDToTypeID( "FlCn" ); var idGry = charIDToTypeID( "Gry " ); desc7.putEnumerated( idUsng, idFlCn, idGry ); var idOpct = charIDToTypeID( "Opct" ); var idPrc = charIDToTypeID( "#Prc" ); desc7.putUnitDouble( idOpct, idPrc, 100.000000 ); var idMd = charIDToTypeID( "Md " ); var idBlnM = charIDToTypeID( "BlnM" ); var idNrml = charIDToTypeID( "Nrml" ); desc7.putEnumerated( idMd, idBlnM, idNrml ); executeAction( idFl, desc7, DialogModes.NO ); } function whichRadBtnClicked(radBtns){ var idx = null; for(i=0;i<radBtns.length;i++){ if(radBtns[i].value === true){ //this is the clicked radio button idx = i; i = radBtns.length; } } return idx; } function selectBrushTool(){ var idslct = charIDToTypeID( "slct" ); var desc6 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref5 = new ActionReference(); var idPbTl = charIDToTypeID( "PbTl" ); ref5.putClass( idPbTl ); desc6.putReference( idnull, ref5 ); executeAction( idslct, desc6, DialogModes.NO ); }
|
|
|
Post by Bailey on May 29, 2019 13:31:37 GMT
** Sharpen Image Using High Pass Filter **This script will sharpen an image using the High Pass Filter Method (Non-destructive). I normally use the Unsharp Mask to sharpen images but occasionally I use the High Pass Filter to fine tune the final sharpening The script will - 1. Present the dialog box on the right so you can select how the script will run. 2. Prompt you to sharpen just the active document in the photo bin or sharpen all the documents in the photo bin in one go. 3. I set the default pixel radius to 4 in the PSE High Pass Filter dialog box. You can change it to whatever you like but the script does not validate the pixel radius you enter. If the entered value is invalid then the script will abort. 4. By default the PSE High Pass Filter dialog box will appear for each image so you can choose your own pixel radius to suit the image. You can uncheck the checkbox if you prefer to apply the default pixel radius to each image. 5. Enable the "Sharpen Images" button when one of the radio buttons is selected. 6. Output a High Pass sharpened layer named "High Pass Filter Sharpening" at the top of the image's layer stack.
/*--------------------------------------------------------------- Create the dialog box ---------------------------------------------------------------*/ var dlg = new Window( "dialog", "Sharpen With High Pass Filter" ); dlg.size = [ 400, 300 ]; dlg.resizeable = true; var pnlRadBtns = dlg.add('panel', undefined, 'Sharpen Active or All Opened Documents'); var grpRadBtns = pnlRadBtns.add('group'); grpRadBtns.alignChildren = ['left','left']; grpRadBtns.margins = [10,10,0,10]; grpRadBtns.orientation = 'column'; var radActiveDoc = grpRadBtns.add('radiobutton',undefined,'Active document'); var radAllDocs = grpRadBtns.add('radiobutton',undefined,'All documents in photo bin'); //Create panel for checkboxes var pnlChkBox = dlg.add('panel', undefined, 'High Pass Filter Options'); var grpChkBox = pnlChkBox.add('group'); grpChkBox.alignChildren = ['left','left']; grpChkBox.margins = [10,10,0,10]; grpChkBox.orientation = 'column'; var chkDispHpDlg = pnlChkBox.add('checkbox', undefined, 'Display High Pass Filter Dialog Box'); chkDispHpDlg.value = true; grpInpBox = grpChkBox.add('group'); grpInpBox.orientation = 'row'; var inpPixRad = grpInpBox.add('edittext'); inpPixRad.text = 4; //default pixel radius for high pass filter grpInpBox.add('statictext{text:"High Pass Filter Pixel Radius"}'); //Create panel for Cancel and Submit buttons var pnlSubmitBtns = dlg.add('panel', undefined, ''); pnlSubmitBtns.orientation = 'row'; pnlSubmitBtns.alignChildren = ['','top']; pnlSubmitBtns.cancelBtn = pnlSubmitBtns.add('button', undefined, 'Cancel',{name:'cancel'}); pnlSubmitBtns.submitBtn = pnlSubmitBtns.add('button', undefined, 'Sharpen Images',{name:'ok'}); pnlSubmitBtns.submitBtn.enabled = false; // **** add event handlers **** pnlSubmitBtns.submitBtn.addEventListener('click',runSubmit); pnlSubmitBtns.cancelBtn.addEventListener('click',cancelScript); for(i=0;i<pnlRadBtns.children.length;i++){ pnlRadBtns.children[i].addEventListener('click',function(){pnlSubmitBtns.submitBtn.enabled = true;}); } dlg.show(); //================================================================================ function runSubmit (){ var selRadBtnIdx = whichRadBtnClicked(grpRadBtns.children); var numOpenDocs = app.documents.length; for(i=0;i<numOpenDocs;i++){ if(selRadBtnIdx === 0){ //process only current active document i=numOpenDocs; }else{ //loop through all documents in the photo bin app.activeDocument = app.documents[i]; } app.displayDialogs = DialogModes.NO; //turn off display PSE dialog boxes currDoc = app.activeDocument; var numOrigLayers = currDoc.artLayers.length; //store the original number of layers in the file currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer if(numOrigLayers >1){ //check if there are more than 1 layer in the original stack stampVisibleLayers(); //Stamp/merge all visible layers to top of the layer stack currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer currDoc.activeLayer.name = "Merged Original"; } currDoc.activeLayer = currDoc.activeLayer.duplicate(); currDoc.activeLayer.name = "High Pass Filter Sharpening"; if (chkDispHpDlg.value == true){ app.displayDialogs = DialogModes.ALL; //turn on display PSE dialog boxes } currDoc.activeLayer.applyHighPass(inpPixRad.text); currDoc.activeLayer.blendMode = BlendMode.OVERLAY; if(numOrigLayers >1){ //remove now redundant 'Merged Original' layer currDoc.artLayers.getByName('Merged Original').remove(); } } dlg.close(); } //============================================================== // Functions //==============================================================
function cancelScript(){ dlg.close(); exit(); } function stampVisibleLayers(){ var idMrgV = charIDToTypeID( "MrgV" ); var desc37 = new ActionDescriptor(); var idDplc = charIDToTypeID( "Dplc" ); desc37.putBoolean( idDplc, true ); executeAction( idMrgV, desc37, DialogModes.NO ); } function whichRadBtnClicked(radBtns){ var idx = null; for(i=0;i<radBtns.length;i++){ if(radBtns[i].value === true){ //this is the clicked radio button idx = i; i = radBtns.length; } } return idx; }
|
|
|
Post by Bailey on May 31, 2019 5:18:04 GMT
** Create Neutral Density Graduated Filter ** Yesterday in another thread someone mentioned they do not own a Neutral Density Graduated Filter.
You can create a neutral density effect quite easily in PSE. There are a few ways you can do it. The technique I use is adding a Gradient Adjustment Layer with a black to transparent gradient. The adjustment layer allows me to move, rotate and scale the gradient as I like to suit the image and to produce the effect I am after.
The script will - 1. Present the dialog box on the right so you can select how the script will run. 2. Prompt you to create a Neutral Density Graduated Filter layer just on the active document in the photo bin or on all the documents in the photo bin in one go. 3. Enable the "Create ND Layer" button when one of the radio buttons is selected. 4. Output a Neutral Density Graduated Filter layer named "ND Graduated Filter" at the top of the image's layer stack. You can then manually adjust the Adjustment Layer, as described above, by double-clicking on it in the layer stack to bring up the Gradient Adjustment Layer dialog box.
/*--------------------------------------------------------------- Create the dialog box ---------------------------------------------------------------*/ var dlg = new Window( "dialog", "ND Graduated Filter" ); dlg.size = [ 400, 300 ]; dlg.resizeable = true; var pnlRadBtns = dlg.add('panel', undefined, 'Add ND Graduated Filter Layer'); var grpRadBtns = pnlRadBtns.add('group'); grpRadBtns.alignChildren = ['left','left']; grpRadBtns.margins = [10,10,0,10]; grpRadBtns.orientation = 'column'; var radActiveDoc = grpRadBtns.add('radiobutton',undefined,'Active document'); var radAllDocs = grpRadBtns.add('radiobutton',undefined,'All documents in photo bin'); //Create panel for Cancel and Submit buttons var pnlSubmitBtns = dlg.add('panel', undefined, ''); pnlSubmitBtns.orientation = 'row'; pnlSubmitBtns.alignChildren = ['','top']; pnlSubmitBtns.cancelBtn = pnlSubmitBtns.add('button', undefined, 'Cancel',{name:'cancel'}); pnlSubmitBtns.submitBtn = pnlSubmitBtns.add('button', undefined, 'Create ND Layer',{name:'ok'}); pnlSubmitBtns.submitBtn.enabled = false; // **** add event handlers **** pnlSubmitBtns.submitBtn.addEventListener('click',runSubmit); pnlSubmitBtns.cancelBtn.addEventListener('click',cancelScript); for(i=0;i<pnlRadBtns.children.length;i++){ pnlRadBtns.children[i].addEventListener('click',function(){pnlSubmitBtns.submitBtn.enabled = true;}); } dlg.show(); //================================================================================ function runSubmit (){ var selRadBtnIdx = whichRadBtnClicked(grpRadBtns.children); var numOpenDocs = app.documents.length; setForegroundRGBColour(0,0,0); for(i=0;i<numOpenDocs;i++){ if(selRadBtnIdx === 0){ //process only current active document i=numOpenDocs; }else{ //loop through all documents in the photo bin app.activeDocument = app.documents[i]; } app.displayDialogs = DialogModes.NO; //turn off display PSE dialog boxes currDoc = app.activeDocument; var numOrigLayers = currDoc.artLayers.length; //store the original number of layers in the file currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer createNDGraduatedFilterLayer(); currDoc.activeLayer = currDoc.artLayers[0]; currDoc.activeLayer.name = "ND Graduated Filter"; currDoc.activeLayer.blendMode = BlendMode.SOFTLIGHT; } dlg.close(); } //============================================================== // Functions //==============================================================
function cancelScript(){ dlg.close(); exit(); } function whichRadBtnClicked(radBtns){ var idx = null; for(i=0;i<radBtns.length;i++){ if(radBtns[i].value === true){ //this is the clicked radio button idx = i; i = radBtns.length; } } return idx; } function createNDGraduatedFilterLayer(){ var idMk = charIDToTypeID( "Mk " ); var desc24 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref21 = new ActionReference(); var idcontentLayer = stringIDToTypeID( "contentLayer" ); ref21.putClass( idcontentLayer ); desc24.putReference( idnull, ref21 ); var idUsng = charIDToTypeID( "Usng" ); var desc25 = new ActionDescriptor(); var idType = charIDToTypeID( "Type" ); var desc26 = new ActionDescriptor(); var idRvrs = charIDToTypeID( "Rvrs" ); desc26.putBoolean( idRvrs, true ); var idAngl = charIDToTypeID( "Angl" ); var idAng = charIDToTypeID( "#Ang" ); desc26.putUnitDouble( idAngl, idAng, 90.000000 ); var idType = charIDToTypeID( "Type" ); var idGrdT = charIDToTypeID( "GrdT" ); var idLnr = charIDToTypeID( "Lnr " ); desc26.putEnumerated( idType, idGrdT, idLnr ); var idGrad = charIDToTypeID( "Grad" ); var desc27 = new ActionDescriptor(); var idNm = charIDToTypeID( "Nm " ); desc27.putString( idNm, """$$$/DefaultGradient/ForegroundToTransparent=Foreground to Transparent""" ); var idGrdF = charIDToTypeID( "GrdF" ); var idGrdF = charIDToTypeID( "GrdF" ); var idCstS = charIDToTypeID( "CstS" ); desc27.putEnumerated( idGrdF, idGrdF, idCstS ); var idIntr = charIDToTypeID( "Intr" ); desc27.putDouble( idIntr, 4096.000000 ); var idClrs = charIDToTypeID( "Clrs" ); var list17 = new ActionList(); var desc28 = new ActionDescriptor(); var idClr = charIDToTypeID( "Clr " ); var desc29 = new ActionDescriptor(); var idRd = charIDToTypeID( "Rd " ); desc29.putDouble( idRd, 0 ); var idGrn = charIDToTypeID( "Grn " ); desc29.putDouble( idGrn, 0 ); var idBl = charIDToTypeID( "Bl " ); desc29.putDouble( idBl, 0 ); var idRGBC = charIDToTypeID( "RGBC" ); desc28.putObject( idClr, idRGBC, desc29 ); var idType = charIDToTypeID( "Type" ); var idClry = charIDToTypeID( "Clry" ); var idUsrS = charIDToTypeID( "UsrS" ); desc28.putEnumerated( idType, idClry, idUsrS ); var idLctn = charIDToTypeID( "Lctn" ); desc28.putInteger( idLctn, 0 ); var idMdpn = charIDToTypeID( "Mdpn" ); desc28.putInteger( idMdpn, 50 ); var idClrt = charIDToTypeID( "Clrt" ); list17.putObject( idClrt, desc28 ); var desc30 = new ActionDescriptor(); var idClr = charIDToTypeID( "Clr " ); var desc31 = new ActionDescriptor(); var idRd = charIDToTypeID( "Rd " ); desc31.putDouble( idRd, 0 ); var idGrn = charIDToTypeID( "Grn " ); desc31.putDouble( idGrn, 0 ); var idBl = charIDToTypeID( "Bl " ); desc31.putDouble( idBl, 0 ); var idRGBC = charIDToTypeID( "RGBC" ); desc30.putObject( idClr, idRGBC, desc31 ); var idType = charIDToTypeID( "Type" ); var idClry = charIDToTypeID( "Clry" ); var idUsrS = charIDToTypeID( "UsrS" ); desc30.putEnumerated( idType, idClry, idUsrS ); var idLctn = charIDToTypeID( "Lctn" ); desc30.putInteger( idLctn, 4096 ); var idMdpn = charIDToTypeID( "Mdpn" ); desc30.putInteger( idMdpn, 50 ); var idClrt = charIDToTypeID( "Clrt" ); list17.putObject( idClrt, desc30 ); desc27.putList( idClrs, list17 ); var idTrns = charIDToTypeID( "Trns" ); var list18 = new ActionList(); var desc32 = new ActionDescriptor(); var idOpct = charIDToTypeID( "Opct" ); var idPrc = charIDToTypeID( "#Prc" ); desc32.putUnitDouble( idOpct, idPrc, 100.000000 ); var idLctn = charIDToTypeID( "Lctn" ); desc32.putInteger( idLctn, 0 ); var idMdpn = charIDToTypeID( "Mdpn" ); desc32.putInteger( idMdpn, 50 ); var idTrnS = charIDToTypeID( "TrnS" ); list18.putObject( idTrnS, desc32 ); var desc33 = new ActionDescriptor(); var idOpct = charIDToTypeID( "Opct" ); var idPrc = charIDToTypeID( "#Prc" ); desc33.putUnitDouble( idOpct, idPrc, 0.000000 ); var idLctn = charIDToTypeID( "Lctn" ); desc33.putInteger( idLctn, 4096 ); var idMdpn = charIDToTypeID( "Mdpn" ); desc33.putInteger( idMdpn, 50 ); var idTrnS = charIDToTypeID( "TrnS" ); list18.putObject( idTrnS, desc33 ); desc27.putList( idTrns, list18 ); var idGrdn = charIDToTypeID( "Grdn" ); desc26.putObject( idGrad, idGrdn, desc27 ); var idgradientLayer = stringIDToTypeID( "gradientLayer" ); desc25.putObject( idType, idgradientLayer, desc26 ); var idcontentLayer = stringIDToTypeID( "contentLayer" ); desc24.putObject( idUsng, idcontentLayer, desc25 ); executeAction( idMk, desc24, DialogModes.NO ); } function setForegroundRGBColour(redChan,greenChan,blueChan){ app.foregroundColor.rgb.red = redChan; app.foregroundColor.rgb.red = greenChan; app.foregroundColor.rgb.red = blueChan; }
|
|
pontiac1940
CE Members
Posts: 6,359
Open to constructive criticism of photos: Yes
|
Post by pontiac1940 on May 31, 2019 15:37:14 GMT
RE: Create Neutral Density Graduated Filter Thanks for this post, but I've no idea how these work and not interested. Perhaps these code scripts are useful to some. Most of us mortals make suitable levels adjustments in ACR and PSE. Having ND filter capability on the computer does nothing for someone taking photos in the field with no ND filter. At the falls, I was using a polarizer that tends (depending on aspect to the sun) to drop one f stop or more. But without an ND filter on the camera, the min shutter speed was restricted. 1/13 sec was okay, but 1/4 second (below) was too fast and the scene over exposed and the whites blown. Unless someone has magical properties, no amount of code and technology will dredge details out of whites. Over half of the white water here is pure white. So post processing is pointless since triple 255 white is still white. As far as I know, an ND filter on the camera would have been the only way to slow thes shutter speed more than I was able to do.
|
|
|
Post by Bailey on Jun 1, 2019 2:07:42 GMT
Hi Clive, RE: Create Neutral Density Graduated Filter Thanks for this post, but I've no idea how these work and not interested. Perhaps these code scripts are useful to some. Most of us mortals make suitable levels adjustments in ACR and PSE. ... To be honest, I have no idea what you are rambling on about here. The point I was making is that if someone (and that includes moi) doesn't have a GND filter, you can easily simulate its effect in PSE. If you have no use for the script that is totally fine by me. I am sure there are many other visitors to this forum who also have no use for these scripts. But I do know that this thread and my similar thread elsewhere are serving their purpose because from the feedback I have received, some "mere mortals" as you refer to us, have actually copy/pasted some of the scripts and used them. I assume you are aware that posts in these types of forums are not one-on-one communications and that anyone with access to the Internet can potentially see them and make use of them if they are appropriate for them. I see from this web-site's home page that many more visiting non-members than members visit this web site each day. This thread, just like any thread and the posts in it can come up in Google or other search engine queries. So who knows how many people any particular thread might or might not help. Also, as I mentioned in an earlier post, no-one needs to know anything at all about Javascript or programming in general just like they do not need to know anything about what is happening "under the bonnet" when they run a Photoshop Action in PSE, to actually run scripts or actions. To run a script in PSE, all you need to do is open the script file using File -> Open as I described in my OP. I don't know how Adobe could have made it any easier for users to run scripts I use a GND Filter simulation technique (my script in this thread) in PSE reasonably often, especially when I have a really bright (compared to the rest of the scene) sky I want to darken and still make it look natural. The simulated GND filter technique I use works really well in my experience. There is truckloads and truckloads of information on the www about what a GND filter is and its uses and how to simulate a GND filter in PSE.
|
|
|
Post by Bailey on Jun 3, 2019 12:12:29 GMT
** Extend Document Canvas **The script will - 1. Present the dialog box on the right so you can select how the script will run. 2. Prompt you to extend the canvas on just the active document in the photo bin or on all the documents in the photo bin in one go. 3. Prompt you to enter how much wider and higher, in pixels and/or percent, you want to make the canvas. 4. Prompt you to choose one of the 9 PSE anchor points from which to apply the canvas extension. The anchor points are the same as those available in the PSE resize canvas dialog box. 5. Prompt you to choose whether you would like the files to be automatically saved in PSD format after their canvas has been extended. 6. Enable the "Extend Canvas" button when one of the radio buttons is selected. For me personally, I will probably use this script only when I have multiple files in the photo bin that need their canvas extended. Otherwise for a single file, the built in PSE canvas resizing feature works well for me. Over time I will add more options for the units of the width and height extensions (mm, inches etc). Atm the available units are pixels and percent.
var anchorPoints = ['Bottom Centre','Bottom Left','Bottom Right','Middle Centre','Middle Left','Middle Right','Top Centre','Top left','Top Right']; var extnUnits = ['percent','pixels']; /*--------------------------------------------------------------- Create the dialog box ---------------------------------------------------------------*/ var dlg = new Window( "dialog", "Extend Document Canvas" ); dlg.size = [ 700, 300 ]; dlg.resizeable = true; var pnlRadBtns = dlg.add('panel', undefined, 'Extend Active or All Opened Documents'); var grpRadBtns = pnlRadBtns.add('group'); grpRadBtns.alignChildren = ['left','left']; grpRadBtns.margins = [10,10,0,10]; grpRadBtns.orientation = 'column'; var radActiveDoc = grpRadBtns.add('radiobutton',undefined,'Active document'); var radAllDocs = grpRadBtns.add('radiobutton',undefined,'All documents in photo bin'); //Create panel for checkboxes var pnlChkBox = dlg.add('panel', undefined, 'Extend Canvas'); var grpChkBox = pnlChkBox.add('group'); grpChkBox.alignChildren = ['left','left']; grpChkBox.margins = [10,10,0,10]; grpChkBox.orientation = 'column'; var chkSaveFiles = pnlChkBox.add('checkbox', undefined, 'Save files after extending'); chkSaveFiles.value = false; grpInpBox = grpChkBox.add('group'); grpInpBox.orientation = 'row'; //Create the canvas width and height extension inputs grpSelExtns = grpInpBox.add('group'); grpSelExtns.orientation = 'row'; grpSelExtns.add('statictext{text:"Extend Width by "}'); var inpWidthExtensionPerc = grpSelExtns.add('edittext'); inpWidthExtensionPerc.text = 0; var selWidthUnits = grpSelExtns.add('dropdownlist',undefined,extnUnits); selWidthUnits.selection = 0; selWidthUnits.preferredSize = [70,20]; grpSelExtns.add('statictext{text:"Extend Height by "}'); var inpHeightExtensionPerc = grpSelExtns.add('edittext'); inpHeightExtensionPerc.text = 0; var selHeightUnits = grpSelExtns.add('dropdownlist',undefined,extnUnits); selHeightUnits.selection = 0; selHeightUnits.preferredSize = [70,20]; grpInpBox.add('statictext{text:"Achor Point"}'); var selAnchPoint = grpInpBox.add('dropdownlist', undefined, anchorPoints); selAnchPoint.selection = 3; //Create panel for Cancel and Submit buttons var pnlSubmitBtns = dlg.add('panel', undefined, ''); pnlSubmitBtns.orientation = 'row'; pnlSubmitBtns.alignChildren = ['','top']; pnlSubmitBtns.cancelBtn = pnlSubmitBtns.add('button', undefined, 'Cancel',{name:'cancel'}); pnlSubmitBtns.submitBtn = pnlSubmitBtns.add('button', undefined, 'Extend Canvas',{name:'ok'}); pnlSubmitBtns.submitBtn.enabled = false; // **** add event handlers **** pnlSubmitBtns.submitBtn.addEventListener('click',runSubmit); pnlSubmitBtns.cancelBtn.addEventListener('click',cancelScript); for(i=0;i<pnlRadBtns.children.length;i++){ pnlRadBtns.children[i].addEventListener('click',function(){pnlSubmitBtns.submitBtn.enabled = true;}); } dlg.show(); //================================================================================ function runSubmit (){ var selRadBtnIdx = whichRadBtnClicked(grpRadBtns.children); var numOpenDocs = app.documents.length; for(i=0;i<numOpenDocs;i++){ if(selRadBtnIdx === 0){ //process only current active document i=numOpenDocs; }else{ //loop through all documents in the photo bin app.activeDocument = app.documents[i]; } app.displayDialogs = DialogModes.NO; //turn off display PSE dialog boxes var currDoc = app.activeDocument; widthExtnUnitsIdx = selWidthUnits.selection.index; heightExtnUnitsIdx = selHeightUnits.selection.index; var widthExt = new UnitValue(inpWidthExtensionPerc.text,extnUnits[widthExtnUnitsIdx]); var heightExt = new UnitValue(inpHeightExtensionPerc.text,extnUnits[heightExtnUnitsIdx]); if(widthExtnUnitsIdx == 1){ widthExt += currDoc.width.value; }else{ widthExt += 100; } if(heightExtnUnitsIdx == 1){ heightExt += currDoc.height.value; }else{ heightExt += 100; } switch(selAnchPoint.selection.index){ case 0: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.BOTTOMCENTER); break; case 1: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.BOTTOMLEFT); break; case 2: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.BOTTOMRIGHT); break; case 3: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.MIDDLECENTER); break; case 4: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.MIDDLELEFT); break; case 5: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.MIDDLERIGHT); break; case 6: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.TOPCENTER); break; case 7: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.TOPLEFT); break; case 8: currDoc.resizeCanvas(widthExt,heightExt,AnchorPosition.TOPRIGHT); break; } if(chkSaveFiles.value === true){ currDoc.saveAs(app.activeDocument.fullName,PhotoshopSaveOptions); } } dlg.close(); } //============================================================== // Functions //==============================================================
function cancelScript(){ dlg.close(); exit(); } function whichRadBtnClicked(radBtns){ var idx = null; for(i=0;i<radBtns.length;i++){ if(radBtns[i].value === true){ //this is the clicked radio button idx = i; i = radBtns.length; } } return idx; }
|
|
|
Post by Bailey on Jun 8, 2019 12:35:28 GMT
For anyone interested, I have modified the Create Dodge & Burn Non-Destructive Layer script so that it now automatically selects the brush tool after the D & B layer has been added to all the open image files in the photo bin or just the active image file.
|
|
|
Post by Bailey on Jun 12, 2019 11:11:44 GMT
I have been reading through the Photoshop Javascript Reference Guide. There is a chapter in there that talks about the <Javascriptresource> which allows custom scripts to behave like plug-ins and so you can then add custom scripts to the File -> Automation Tools menu (I am using PSE 14). <Javascriptresource> is basically XML format data.
<javascriptresource> <name>ND Graduated Filter</name> <about>This script creates a ND Graduated Filter layer</about> <category>My Custom Scripts</category> <menu>automate</menu> </javascriptresource>
In it's simplest form you can add any custom script to the File -> Automation Tools menu by simply inserting the code on the right at the very top of the Javascript file. <name> is the menu item that will appear in the File -> Automation Tools menu. <about> contains a description for the script (plug-in) that will appear if the user selects Help -> About Plug-In <category> scripts with the category will be grouped together in the Automation Tools menu <menu> contains the menu in which the custom scripts will appear. The value "automate" = the File -> Automation Tools menu in PSE. The Javascript file (.jsx) needs to be put in the C:\Program Files\Adobe\Photoshop Elements 14\Presets\Scripts folder. The path will vary slightly according to your version of PSE. So in essence, <Javascriptresource> gives you another option to group and run scripts in PSE in addition to File -> Open as described in my OP.
|
|
|
Post by Bailey on Aug 8, 2019 11:33:38 GMT
** Create A Pencil Sketch **I have just finished converting images to pencil sketches for someone. Since there were quite a few images I built a script to speed up the process. The script is based on the tutorial below. The script will: 1. Convert an image to a pencil sketch. 2. Allow user input to the Gaussian Blur dialogue box. 3. Convert just the active document or all the documents in the Photo Bin. Instruction on how to run the script in PSE are in my OP.
/*--------------------------------------------------------------- Create the dialog box ---------------------------------------------------------------*/ var dlg = new Window( "dialog", "Create Pencil Sketch" ); dlg.size = [ 400, 300 ]; dlg.resizeable = true; var pnlRadBtns = dlg.add('panel', undefined, 'Sketch Active or All Opened Documents'); var grpRadBtns = pnlRadBtns.add('group'); grpRadBtns.alignChildren = ['left','left']; grpRadBtns.margins = [10,10,0,10]; grpRadBtns.orientation = 'column'; var radActiveDoc = grpRadBtns.add('radiobutton',undefined,'Active document'); var radAllDocs = grpRadBtns.add('radiobutton',undefined,'All documents in photo bin'); //Create panel for Cancel and Submit buttons var pnlSubmitBtns = dlg.add('panel', undefined, ''); pnlSubmitBtns.orientation = 'row'; pnlSubmitBtns.alignChildren = ['','top']; pnlSubmitBtns.cancelBtn = pnlSubmitBtns.add('button', undefined, 'Cancel',{name:'cancel'}); pnlSubmitBtns.submitBtn = pnlSubmitBtns.add('button', undefined, 'Create sketch',{name:'ok'}); pnlSubmitBtns.submitBtn.enabled = false; // **** add event handlers **** pnlSubmitBtns.submitBtn.addEventListener('click',runSubmit); pnlSubmitBtns.cancelBtn.addEventListener('click',cancelScript); for(i=0;i<pnlRadBtns.children.length;i++){ pnlRadBtns.children[i].addEventListener('click',function(){pnlSubmitBtns.submitBtn.enabled = true;}); } dlg.show(); //================================================================================ function runSubmit (){ var selRadBtnIdx = whichRadBtnClicked(grpRadBtns.children); var numOpenDocs = app.documents.length; for(i=0;i<numOpenDocs;i++){ if(selRadBtnIdx === 0){ //process only current active document i=numOpenDocs; }else{ //loop through all documents in the photo bin app.activeDocument = app.documents[i]; } app.displayDialogs = DialogModes.NO; //turn off display PSE dialog boxes currDoc = app.activeDocument; var numOrigLayers = currDoc.artLayers.length; //store the original number of layers in the file currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer if(numOrigLayers >1){ //check if there are more than 1 layer in the original stack stampVisibleLayers(); //Stamp/merge all visible layers to top of the layer stack currDoc.activeLayer = currDoc.artLayers[0]; //set top layer as active layer currDoc.activeLayer.name = "Merged Original"; }
currDoc.activeLayer = currDoc.activeLayer.duplicate(); currDoc.activeLayer.desaturate(); currDoc.activeLayer.name = "Original Copy - B&W"; currDoc.activeLayer = currDoc.activeLayer.duplicate(); currDoc.activeLayer.invert(); currDoc.activeLayer.blendMode = BlendMode.COLORDODGE; currDoc.activeLayer.name = "B&W Negative"; app.displayDialogs = DialogModes.ALL; currDoc.activeLayer.applyGaussianBlur(0.1); createLevelsAdjustmentLayer(); } dlg.close(); } //============================================================== // Functions //==============================================================
function cancelScript(){ dlg.close(); } function stampVisibleLayers(){ var idMrgV = charIDToTypeID( "MrgV" ); var desc37 = new ActionDescriptor(); var idDplc = charIDToTypeID( "Dplc" ); desc37.putBoolean( idDplc, true ); executeAction( idMrgV, desc37, DialogModes.NO ); } function whichRadBtnClicked(radBtns){ var idx = null; for(i=0;i<radBtns.length;i++){ if(radBtns[i].value === true){ //this is the clicked radio button idx = i; i = radBtns.length; } } return idx; } function createLevelsAdjustmentLayer(){ var idMk = charIDToTypeID( "Mk " ); var desc73 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref57 = new ActionReference(); var idAdjL = charIDToTypeID( "AdjL" ); ref57.putClass( idAdjL ); desc73.putReference( idnull, ref57 ); var idUsng = charIDToTypeID( "Usng" ); var desc74 = new ActionDescriptor(); var idType = charIDToTypeID( "Type" ); var idLvls = charIDToTypeID( "Lvls" ); desc74.putClass( idType, idLvls ); var idAdjL = charIDToTypeID( "AdjL" ); desc73.putObject( idUsng, idAdjL, desc74 ); executeAction( idMk, desc73, DialogModes.NO ); }
|
|