Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
#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();
}