Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.