Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Selection by color

Explorer ,
Feb 19, 2016 Feb 19, 2016

How can you make a selection based on color

For example, all pixels white?

Something like this:

app.activeDocument.Selection.select(0,White);

Thanks!

TOPICS
Actions and scripting
885
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 19, 2016 Feb 19, 2016

Use the AM code ScriptingListener.plugin creates when you perform the corresponding operation (in this case this could for example be Color Range).

Translate
Adobe
Community Expert ,
Feb 19, 2016 Feb 19, 2016

Use the AM code ScriptingListener.plugin creates when you perform the corresponding operation (in this case this could for example be Color Range).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 20, 2016 Feb 20, 2016

Bonjour

You can use the function selectColorRange()  - xbytor in xtools ( xtools ) - stdlib.js

"

//RechercheBlanc.jsx

//RechercheBlanc.jsx

//Recherche une couleur

var chercheCouleur = new SolidColor();

chercheCouleur.rgb.red=255;

chercheCouleur.rgb.green=255;

chercheCouleur.rgb.blue=255;

selectColorRange(chercheCouleur);

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 );

}

"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2016 Feb 20, 2016

Thank you

It really select the white, but I do not understand anything, what it ActionDescriptor, PutDouble?

And whether it is possible to increase the range of selection, have not only one color?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 21, 2016 Feb 21, 2016

1/

you gotta ask .... xbytor


2/


By using methodes store() load()  - SelectionType.INTERSECT // EXTEND REPLACE ???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 21, 2016 Feb 21, 2016
LATEST

Thank you very much

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines