First can you please tell me what im missing to achieve selection of the brightest pixel or pixels? because im getting confused
now, I have this code...
#target photoshop
// check the histogram;
var theHist = activeDocument.channels[activeDocument.channels.length - 1].histogram;
var theCheck = false;
var theIndex = 255;
while (theCheck == false) {
var thePixels = theHist[theIndex];
// if the value has more than one pixels;
if (thePixels > 0) {var theCheck = true};
theIndex--
};
alert (theIndex);
// =======================================================
var idThrs = charIDToTypeID( "Thrs" );
var desc33 = new ActionDescriptor();
var idLvl = charIDToTypeID( "Lvl " );
desc33.putInteger( idLvl, theIndex );
executeAction( idThrs, desc33, DialogModes.NO );
activeDocument.activeChannels = theArray;
please tell me in order what's left to do?
- To select the channel
- Load the channel
- ...