Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Selecting the brightest pixels

$
0
0

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

- ...


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>