Layer.translate() makes changes in transparent area
- January 23, 2023
- 2 replies
- 605 views
Adobe Photoshop Version: 2017.0.0 20161012.r.53 2016/10/12:23:00:00 CL 1094006 x64
OS: Windows 11
Step 1:- Download the relevant file (Sample.psd).
Step 2:- Load the psd file in Photoshop.
Step 3:- Go to layers --> Layer masks and select “from transparency”. Now separated layer mask can observed in layer panel.
Step 4:- Shift+Click on the layer mask in layer panel. It is not valid now (There is a red mark in layer mask). Observe the current layer in canvas.
Step 5:- Click on the Layer mask and make sure red mark is disappeared. Then Right click on layer mask and select “apply layer mask”
Step 6:- Copy the following line and paste it in a text editor. Save it as Translate.jsx file
app.preferences.rulerUnits = Units.PIXELS;
activeDocument.activeLayer.translate(-100,-50);Step 7:- Go to File--> Scripts and select “browse….”. And select the Translate.jsx file and load it. A translation of layer can be observed.
Step 8:- Again follow the Step 3 and Step 4. Now a color change can be observed.
Expected result: - Before_translate_Without(Layer_mask).png (From uploaded fies)
Actual result:- After_translate_Without(Layer_mask).png (From uploaded files)
