Skip to main content
cindis385
Participant
September 25, 2017
Answered

photoshop count tool

  • September 25, 2017
  • 2 replies
  • 1920 views

I am using the photoshop count tool to manually count objects in images.  Is there a way to save and reuse defined count groups (names and colors) so that I don't have to redefine them for each image?

    This topic has been closed for replies.
    Correct answer War Unicorn

    I believe count groups are only saved per document. I know you can export recorded measurements via the Measurement Log window but I don't think there's any way to import them, plus I think it only does the count, not color.

    2 replies

    c.pfaffenbichler
    Community Expert
    Community Expert
    October 4, 2017

    It doesn’t even need a Script, Actions seem to be able to handle the count group creation and color selection, too.

    cindis385
    cindis385Author
    Participant
    October 4, 2017

    Thank you for your suggestions.  I'm not a programmer so the script won't help me.  I will have to look into the Actions function to see if that might be helpful.

    c.pfaffenbichler
    Community Expert
    Community Expert
    October 4, 2017

    You just need to save the code in a text file with the extension jsx and place it in Photoshop’s Presets/Scripts-Folder, then it should be available under File > Scripts after the next start of the application.

    And you can edit the Script however you need to change the names and RGB values.

    War Unicorn
    Community Expert
    War UnicornCommunity ExpertCorrect answer
    Community Expert
    September 25, 2017

    I believe count groups are only saved per document. I know you can export recorded measurements via the Measurement Log window but I don't think there's any way to import them, plus I think it only does the count, not color.

    c.pfaffenbichler
    Community Expert
    Community Expert
    October 4, 2017

    But one can create them via a Script.

    // 2017, use it at your own risk;

    #target photoshop

    if (app.documents.length > 0) {

    addCountGroup ("the first group", 128, 128, 0);

    addCountGroup ("the second group", 128, 0, 128);

    addCountGroup ("the third group", 0, 128, 128);

    };

    ////// add count group //////

    function addCountGroup (theName, theR, theG, theB) {

    try {

    // =======================================================

    var idcountAddGroup = stringIDToTypeID( "countAddGroup" );

        var desc12 = new ActionDescriptor();

        var idNm = charIDToTypeID( "Nm  " );

        desc12.putString( idNm, theName );

    executeAction( idcountAddGroup, desc12, DialogModes.NO );

    // =======================================================

    var idcountColor = stringIDToTypeID( "countColor" );

        var desc15 = new ActionDescriptor();

        var idRd = charIDToTypeID( "Rd  " );

        desc15.putInteger( idRd, theR );

        var idGrn = charIDToTypeID( "Grn " );

        desc15.putInteger( idGrn, theG );

        var idBl = charIDToTypeID( "Bl  " );

        desc15.putInteger( idBl, theB );

    executeAction( idcountColor, desc15, DialogModes.NO );

    } catch (e) {alert (theName+" failed")}

    };