Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Paul,
I am looking for a jsx-code to automate the detection of the coordinates of the brightest/darkest pixels in a photoshop file.
Searching the forum I found your answer with a link to ps-scripts.com.
Unfortunately the thread you are referring to is not available any more.
Do you have by chance the code from this thread?
Thanks for any help.
Copy link to clipboard
Copied
Paul left here years ago this thread is eleven years old
Copy link to clipboard
Copied
Bonjour
Using the select Color Range function (scrObj)
from Mike Hale :
//Recherche de crame
var blue = new SolidColor();
blue.rgb["hexValue"] = "ffffff" // "829fb1" // "0000ff";
for( var f = 0; f < activeDocument.artLayers.length; f++ ){ activeDocument.activeLayer = activeDocument.artLayers
selectColorRange(blue);
function selectColorRange(scObj){
var desc = new ActionDescriptor();
desc.putInteger( charIDToTypeID( "Fzns" ), 0 );
var cDesc = new ActionDescriptor();
cDesc.putDouble( charIDToTypeID( "Rd " ), scObj.rgb.red);
cDesc.putDouble( charIDToTypeID( "Grn " ), scObj.rgb.green);
cDesc.putDouble( charIDToTypeID( "Bl " ), scObj.rgb.blue );
desc.putObject( charIDToTypeID( "Mnm " ), charIDToTypeID( "RGBC" ), cDesc );
desc.putObject( charIDToTypeID( "Mxm " ), charIDToTypeID( "RGBC" ), cDesc );
executeAction( charIDToTypeID( "ClrR" ), desc, DialogModes.NO );
}
Copy link to clipboard
Copied
And what are you going to do with the coordinates of the pixels? There may be a lot of them.
Copy link to clipboard
Copied
I have a hair in my hand!
Copy link to clipboard
Copied
I am just trying to automate photoshop color correction with a curve adjLayer using it's eyedropper tool for white, grey and black values.
To adjust the curves by script I need to know the coordinates of the brightest highlights, 50% grey values and the deepest shadows in the picture.
Manually I would do that using the slider in a threshold adjLayer to detect the brightest resp. darkest values and marking them with the eyedropper tool (I). Jimmy McIntyre has described this procedure in his "Powerful Color Correction Photoshop Tutorial".
It would be great to do that by script.
Copy link to clipboard
Copied
I do it with several personal jsx scripts
Under Win 10 and CS5
Copy link to clipboard
Copied