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

Selecting custom pixels

New Here ,
Nov 13, 2017 Nov 13, 2017

Copy link to clipboard

Copied

I have binary mask image. What the most convenient way to make selection with form of this mask?

TOPICS
Actions and scripting

Views

709

Translate

Translate

Report

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
Adobe
People's Champ ,
Nov 13, 2017 Nov 13, 2017

Copy link to clipboard

Copied

If I understood correctly, then you can make a selection from the mask like this

app.activeDocument.selection.deselect();

app.runMenuItem(stringIDToTypeID("addUserMaskToSelection"));

Votes

Translate

Translate

Report

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
New Here ,
Nov 14, 2017 Nov 14, 2017

Copy link to clipboard

Copied

This works but there is also a step which i make with hands (Layer Mask > From Transparence). How do i made it in script?

Votes

Translate

Translate

Report

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
People's Champ ,
Nov 14, 2017 Nov 14, 2017

Copy link to clipboard

Copied

LATEST

selection_from_channel("Trsp");

//selection_from_channel("Msk ");

function selection_from_channel(ch_name)

    {

    try {

        var d = new ActionDescriptor();

        var r1 = new ActionReference();

        var r2 = new ActionReference();

        r1.putProperty( charIDToTypeID( "Chnl" ), charIDToTypeID( "fsel" ) );

        r2.putEnumerated( charIDToTypeID( "Chnl" ), charIDToTypeID( "Chnl" ), charIDToTypeID( ch_name ) );

        d.putReference( charIDToTypeID( "null" ), r1 );

        d.putReference( charIDToTypeID( "T   " ), r2 );

        executeAction( charIDToTypeID( "setd" ), d, DialogModes.NO );

        }

    catch(e) { alert(e);}

    }

Also can use 4-chars names

"RGB "

"Rd  "

"Grn "

"Bl  "

"Lab "

"Lght"

"A   "

"B   "

"CMYK"

"Cyn "

"Mgnt"

"Yllw"

"Blck"

Votes

Translate

Translate

Report

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