Mobile app version of vmapp.org
Login or Join
Cofer715

: How do I delete all white pixels from several layers? I have a photoshop file with over a hundred layers. Each of these layers have white backgrounds. I need to remove all of these #FFFFFF

@Cofer715

Posted in: #AdobePhotoshop #Automation #Layers

I have a photoshop file with over a hundred layers. Each of these layers have white backgrounds. I need to remove all of these #FFFFFF pixels automatically. I'm not worried about the actual content being deleted or anything. None of the content contains any pure white pixels.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Cofer715

3 Comments

Sorted by latest first Latest Oldest Best

 

@Speyer780

This is very easy to accomplish with a simple action and simple script.

For an action I started recording a new action called SelectWhite and did Select -> Color Range (selected white) pressed OK then I hit Delete to delete the white, and then I pressed CTRL + D to de-select the current selection.

I then stopped recording my action.

Now you could just use this action manually on every layer or you could use a script to do it for you...

Then here's the code you need for the script:

var doc = app.activeDocument;
for(var i = 0; i < doc.layers.length; i++){
doc.activeLayer = doc.layers[i];
app.doAction("YOUR_ACTION_NAME_HERE", "YOUR_ACTION_SET_NAME_HERE");
doc.activeLayer.visible = false;
}


This script will iterate through every layer and run the action you made on it.

On my computer the app.doAction line of code looked like this:

app.doAction("SelectWhite", "Custom");

Note that the first part "SelectWhite" is the name of your action and "Custom" is the action set the action is part of.

You can just open up Notepad and past this code in there, then save it as a .jsx file.

Now go to:

File -> Scripts -> Browse... and select your script and run it.

That's it!

EDIT If you don't want to do the work yourself, I've extracted the action and script and placed them into a zip file. Just load the action into Photoshop and then run the script like I explained. You may need to adjust that one line of code in the script if there's some naming issues.

10% popularity Vote Up Vote Down


 

@Jessie844

make an ACTION from Scott's answer and apply it to all 100 layers.

10% popularity Vote Up Vote Down


 

@Turnbaugh909

You'll have to remove the white layer by layer. There's no automated processes to strip white from all layers.

If it were me I'd probably use Select > Color Range to grab the white on each layer, then add a mask, repeat for each layer.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme