Automate Green-Screen Layouts in Photoshop CS4

The theory behind shooting portraits on a green-screen background is a good one: Give yourself a solid color that’s easy to select. The problem has always been that it isn’t easy to automate extracting subjects from the background—until now. Here’s a method to create a Photoshop action to extract your subjects and place them in a new background.

Your chances of success in a project like this will depend on the work you do up front. You need good, consistent lighting of the green screen, some distance between your subjects and the background to avoid shadows, and all the portraits should be framed in a similar way. Also, keep your graphic elements in a specific folder. For our example we’re going to use a series of “karate kids.”

Green Screen Tutorial

We’re going to automate the steps of putting these kids onto trading cards, so first we have to create the graphic elements for the card. Create a new file (File>New) for your trading card that matches the size and resolution of your green-screen images. Add each element on a separate layer to your card document so you can edit the results later, such as changing the name for each child, etc. Start by adding all the elements you want, even graphics that eventually will appear in front of the photo (overlays).

Green Screen Tutorial

We need to create separate documents for the overlays. Click on the Eye icons in the Layers panel to hide every layer except the overlays. We’ll start with our red border and the white graphics: Make a selection of the bottom third, Edit>Copy Merged, File>New, click OK, Edit>Paste, and Save this as a layered document. Then do the same thing for the other overlays. In some cases, such as the name banner, you can select both layers (the text layer and banner layer) by Shift-clicking them in the Layers panel, duplicate them (Layer>Duplicate Layers), and select New in the Document drop-down menu in the Duplicate Layer dialog and then Save the new file.

Green Screen Tutorial

Open one of the green screen documents. In the Actions panel (Window>Actions) click on the Create New Action icon at the bottom of the panel and in the dialog, name the action, and if you wish, assign a keyboard shortcut. Click the Record button to start recording the action. (You’ll keep recording until Step 9.)

Green Screen Tutorial

First change the image to LAB mode by going to Image>Mode>Lab Color. Then click on the Channels panel (Window>Channels) and duplicate the a channel by clicking on it and dragging it onto the Create New Channel icon. (This new channel should be called “a copy.”)

Green Screen Tutorial

Use the Image>Mode menu to change back to RGB Color. The “a copy” channel should still be active. From the Edit menu, choose Fill, then in the dialog, choose White from the Use menu, Overlay as the Blending Mode, and click OK. Now use Edit>Fill again, but this time change the Use menu to Black (the Blending Mode should still be set to Overlay). And one more time, use Edit>Fill with Black in Overlay mode. This should create a very good mask (if it needs tweaking, don’t adjust it at this time).

Green Screen Tutorial

Press-and-hold Command (PC: Ctrl) and click on the “a copy” channel to load it as a selection. Now, click on the Layers panel tab, hold down Option (PC: Alt), and double-click on the Background layer to unlock it. Click on the Add Layer Mask icon at the bottom of the Layers panel to add a layer mask to Layer 0 (the former Background layer).

Green Screen Tutorial

Click on the layer thumbnail to make it active, then from the File menu choose Place. In the Place dialog, navigate to your main card background document and click Place. Press Return (PC: Enter) to place the card background on its own layer as a smart object (more on smart objects later). Then in the Layers panel, drag the card layer below the photo layer.

Green Screen Tutorial

Use File>Place to import the overlay graphics (one at a time). In each case, press Enter, reposition the graphic in the document, and then click-and-drag to change the order of the layers in the Layers panel. Choose File>Save As and save it as a PSD. Stop recording the action by clicking on the black square to the left of the red recording icon at the bottom of the Actions panel.

Green Screen Tutorial

Before running a batch action on many images, try your new action on one or two photos. Open a green-screen photo, click on your green-screen action in the Actions panel, and click the Play Selection icon (or press the F-key, if you assigned one to your action).

Green Screen Tutorial

You can run a Batch action either from Adobe Bridge (where you can see and choose your images) or File>Automate>Batch (where you choose a folder). In the Batch dialog, choose your Action and the Source for the files (Bridge or Folder). Then, click the Choose button under Destination and select a folder for the results of your Batch (we created a new folder called “After”). Check the Override Action “Save As” Commands box to save the results as PSDs, but in your destination folder. Click OK to run the batch.

Green Screen Tutorial

You’ll end up with a folder full of PSD versions of the cards, one for each player. To edit their names, open the document and double–click on the Smart Object icon on the overlay layer containing the banner. This opens the document with the original text. Just edit the text, Close, and Save, and it will update in the document for that player.

Green Screen Tutorial

When you Place documents into a Photoshop document, they appear as smart objects, which means that although they appear as one layer, you can still access all the individual layers within that smart object by double-clicking on the Smart Object icon. So you can make changes on any element just like we did for the name in the previous step. When you’re done, just Close and Save the document, and again it will update in the document for that player.

Green Screen Tutorial

In an ideal world this green-screen action would work perfectly but there will always be some exceptions; so be prepared to edit some documents by tweaking the layer mask. You may need to paint on the mask to get the result you want, or if you see a slight fringe of green, use the Masks panel and the Refine Mask dialog (click the Mask Edge button in the Masks panel). Still, it’s much much faster than manually extracting each player!

Green Screen Tutorial

Share & Enjoy


  1. Kole (Reply) on Tuesday January 19, 2010

    nice :)

  2. [...] This post was mentioned on Twitter by Stephanie Moore , Drew Malone. Drew Malone said: Automate Green-Screen Layouts in Photoshop CS4 [...]

  3. [...] click here to go to the tutorial Share This [...]

  4. Federico (Reply) on Tuesday January 19, 2010

    Very Nice tut, i like the use of Lab mode to make the starting point mask.

  5. Robert Anthony (Reply) on Tuesday January 19, 2010

    Good tutorial! I’ve been wanting to get into green screen/after effects. Now you should show us how to DIY a green screen backdrop/setup!!

  6. Jeff Zappariello (Reply) on Tuesday January 19, 2010

    What about the color cast?

  7. Bob Pinaha (Reply) on Tuesday January 19, 2010

    I’ve always loved Dave’s tutorials and this one was great! I did however, expect to see the tutorial end with Dave’s personalization trademark of his videos. It would have been cool to see Dave in the last step in the trading card all decked out in karate uniform. Great tutorial!

  8. Marco (Reply) on Tuesday January 19, 2010

    If you happen to have Adobe’s Master Suite you can also import the greenscreen image into After Effects and use the excellent Keyhole plugin that comes bundled with it to extract the foreground. Export Still to Photoshop for further processing.

  9. Adrian (Reply) on Tuesday January 19, 2010

    Is it possible for you to share the ready use action, please? :)

  10. chika jerry (Reply) on Tuesday January 19, 2010

    i really want to learn photo shop .but ,i do not know were the software.can you please help me out

  11. Affu (Reply) on Tuesday January 19, 2010

    Maza aagaya

  12. Earl Berentson (Reply) on Tuesday January 19, 2010

    Cool. Thanks

  13. Sam (Reply) on Tuesday January 19, 2010

    It look it might work remove green screen, but if you have let say 100 images or even 1000 then try
    our software The Green Genie , it is green screen software remover with Photoshop ,which it will remove green screen using Photoshop and also will create a mask which you can refine it, visit the web

  14. Nick (Reply) on Tuesday January 19, 2010

    Not the best results as a green screen removal method for high detail images – the 2nd fill with black tends to wipe out hair detail on people who have hair, as opposed tho the crew cuts on the models.

    I suspect the extract plugin may be a better option for such uses or of course After Effects

Planet Photoshop Photoshop World KelbyOne Lightroom Killer Tips Scott Kelby