1 Reply Latest reply on Jun 14, 2017 8:39 AM by SuperMerlin

    How to change pixel color with javascript in Photoshop?

    gunarsb72611734

      I have layer in Photoshop where with brush is drawn something. I need to read this layer pixel for instance pixel with coordinates (100,100) and write to new layer this pixel with changed pixel color. How to do it with javascript? I use Photoshop CC.

        • 1. Re: How to change pixel color with javascript in Photoshop?
          SuperMerlin Level 5
          #target photoshop;
          if(documents.length){
          var Left = 100;
          var Right = 101;
          var Top = 100;
          var Bottom = 101;
          var fillColour = new SolidColor();
          fillColour.rgb.hexValue="00ff00";
          activeDocument.selection.select([[Left,Top],[Right,Top],[Right,Bottom],[Left,Bottom]], SelectionType.REPLACE, 0, false);
          executeAction(charIDToTypeID( "CpTL" ), undefined, DialogModes.NO );
          activeDocument.selection.select([[Left,Top],[Right,Top],[Right,Bottom],[Left,Bottom]], SelectionType.REPLACE, 0, false);
          activeDocument.selection.fill(fillColour);
          activeDocument.selection.deselect();
          }