: Automate erasing certain colors in multiple PSD files Is it possible to erase all colors in the 2nd layer of a PSD file in Photoshop except yellow in one step? I have multiple images. Should
Is it possible to erase all colors in the 2nd layer of a PSD file in Photoshop except yellow in one step?
I have multiple images. Should I use the hex code to preserve the yellow color?
More posts by @Heady304
2 Comments
Sorted by latest first Latest Oldest Best
I'm going to create an action to remove all colors except yellow. Then I'll create a script that get each *.psd files in D:/myFolder and will apply the action to second layer of each loaded file. Then I will save each file in the same path. so....
First create an Action
Press Alt + F9 to open Action window
Click on "Create a set" button and rename it to mySet
Click on "Create an Action" button and rename it to myAction
Go to Select -> Color Range (selected Yellow) pressed OK
Press Ctrl + Shift + i (to inverse selection)
Hit Delete button on keyboard to delete the Selected colors
press CTRL + D to deselect the current selection
Second create a Script
Create a folder in drive D and rename it to myFolder ("D:/myFolder") and copy & paste all psd files there. (Keep source files in another directory)
Open notepad and copy and paste the following code
Save the file with ".jsx" extention
Go to Photoshop -> File -> Scripts -> Browse... and select your
script and run it
var inFolder = new Folder("D:/myFolder")
if(inFolder != null)
{
var fileList = inFolder.getFiles(/.(tif|psd|)$/i);
}
for(var i = 0 ;i < fileList.length; i++)
{
var docRef = open(fileList[i]);
var doc = app.activeDocument;
doc.activeLayer = doc.layers[1];
app.doAction("myAction", "mySet");
doc.close(SaveOptions.SAVECHANGES);
}
That's it
It's not possible in one step, but in a few perhaps. Make a selection of the yellow colour using Select > Colour Range, and use the colour picker to select the yellow item, and adjust the fuzziness and range sliders until you get a good selection, then add a layer mask to the layer.
Example:
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.