Stop Using Unsharp Mask in Photoshop!

Started Oct 19, 2021 | Discussions thread
lambertj Regular Member • Posts: 217
Re: Stop Using Unsharp Mask in Photoshop!
5

Sternodox wrote:

I know it's quick and dirty ... mostly dirty. Use the High Pass filter instead. Here's how:

First duplicate your base layer. Then choose Filters -> Other -> High Pass. Give it a value of 12. Or 8. Or 17. Just put a number in there. Now merge your layers using Overlay. Isn't that great? Now adjust the opacity of the top layer to get the sharpness you want. After a bit of practice you'll find which High Pass number works best for the sharpness you need. This is a great way to salvage a not-quite-sharp-enough photo.

I used to use Unsharp Mask and High Pass Filter Sharpening until I got Topaz Sharpen AI which for me does a much better and cleaner job.

I use Photoshop Elements and since it and Photoshop both support JavaScript I wrote a program to do High Pass Sharpening on either just the active document or it will loop through all the documents open in the Photo Bin.

I prefer Javascript rather than actions because I can code the script to prompt for user inputs with customised dialogue boxes including whether to run on all the docs in the photo bin or just the active doc.

If anyone wants it, this one is on the house

Just copy/paste into a text file anywhere on your pc and give it a .jsx extension.

Then in either Photoshop Elements or Photoshop do File->Open, navigate to your .jsx file and open it. Opening it runs the script.

The High Pass dialogue box will pop up and I have set the default radius to 4px which I find suits most images. You can adjust to suit.

I have only run the script in PSE but it should work in PS.

/*---------------------------------------------------------------
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;
}

Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow