The problem of chroma-key green screen removal in Photoshop is not uncommon in product image editing. Unfortunately for us, retouchers. It came to photography from the video industry. Some guy just thought: “Okay, so you can isolate people on video if you shoot them up a green screen, why don't we do the same thing with our images to isolate them automatically?”. It might sound reasonable, but in fact, as it turned out to be, most photography studios are unable to shoot images on chroma key green screens properly, and isolating chroma key images that were not shot properly is much harder than isolating a plain white or light gray background. That's the deal.
The majority of chroma key images I've seen in my life was shot poorly, mostly because people who set the whole thing up didn't realize how complicated this idea was. If you just put a person up against a green screen without proper preparations on stage, you'll get images retouchers will be crying over. Why is that? Well, here's a list of demands that you have to follow if you want to be able to isolate chromakey backgrounds automatically.
r subject has to be placed as fa r fro m the green screen as possible. Otherwise, you'll get green spil l al l ove r the model and the clothe s they are wearing.
- The screen should be lighted separately with additional sources of light. The screen has to be bright green, not dark, and your model should not cast any shadows on it. You can isolate bright green easily, but not dark green.
- The screen should be tight,
n o wrinkles.
There's more to it than these three rules, but they are the most important. And if you keep that in mind, setting up a chromakey environment is not as easy as it sounds at first glance. Distance matters the most. How far should the model be from the screen? At least 1.5, better 3 meters. It will not just reduce the green spill, it will keep the screen out of focus, too, which also makes isolation somewhat easier. That requires you to shoot in a big room, and the bigger the room, the higher the rent. It also requires additional light sources, because if your screen is dark green, you won't be able to get rid of it so easily. And it also should be smooth, not wrinkled.
All this will let you use Photoshop to get rid of all the background at once automatically, just like they do it in the movies. This is what I'm going to teach you. But don't expect any miracles, because chromakey is basically a color range selection based isolation. What does that mean? We assume that bright green is not a popular color, so we just select the whole range and replace it with white or any other color we need for the background. But if your model is wearing a green dress, it will get all messed up. So, problem number one of the chroma key technology is that it can't really distinguish between the green screen and green items, it just removes it all. In
And this is not just about green clothes. Chromakey is notorious for its green spill everywhere. I once worked in a studio with a chromakey mannequin stand, and it was casting green reflexes all over the place. They shot shoes on a white backdrop three meters from the green mannequin and its green background, and almost all the shoes had a green fringe around because of that. Dealing with this green spill is really bothersome. Keeping the screen as far from your subject as possible helps, but it doesn't eradicate the green fringe. You'll have to deal with that.
If you google chroma key images isolation, you won't get much help. There are not so many tutorials available for free, and when people discuss the matter, they don't seem to use any advanced methods of isolation. They just say “Use the Select Color Range command” or even “Just click on the background with the Magic Wand”. Why setting the whole green thing up if you're treating it just like any other background? Don't do that. Color range selection is NOT a proper way to handle chroma key because we only use chroma key to be able to remove the green color automatically. Boring clicking with the color range eyedropper is the opposite of automatic.
I've also seen tutorials that suggest you create a mask by getting an A channel from the Lab color mode and adjusting it will the Levels and manually, by using a variety of brushes until you have a nice black and white and image which can be used to isolate the background. This is a more or less classic approach described by many renowned retouchers, and it's actually the right way. Except for the manual mask painting and tweaking part – as it's tricky and time-consuming. While there's nothing wrong with the mask manual enhancing itself – this method is widely used and has many applications, I assure you, this is not really something that should be done in
So, here's a typical chroma key image that was produced without much care and attention to the setup. The model is casting a huge shadow on the background, which is not really well lit. It is dark green. A shadow on a screen is really bad for the chroma key
Now it's a good time to test my chromakey isolation action. Let's just run it and then see what it does. I'll go back in History to the step just before the action has started executing commands. The first thing it does is convert the image to the Lab mode. That's because there's a channel in the Lab mode that contains all the information for the green color. It's the “A” channel. The action duplicates it so that it can be used later and converts the image back to RGB mode. Nothing has changed so far, we just have one of the Lab channels available in RGB mode. Then we get the Background layer copied and the “A” channel is applied to it. This is the first sketch of our future isolation mask. Then it applies an image once again, this time it applies the “A” channel image on top of itself, but inverted, and the Blending mode is Divide. In the Divide blending mode, pixel values get divided with each other and it lets us brighten the guy while keeping the background gray. That's because in the “A” channel everything that is green is dark, and the rest is neutral gray. The divide blending mode turns neutral gray into white and this is how we get this result.
But that's not good enough, so we'll do some more blending. It copies the layer and fills it with a white solid color in the Exclusion blending mode. Now that's better. Merge this down and make one more copy, and fill it with solid color again this time it's 50% gray and the Blending mode is the Divide. We're actually close to a good mask. Now we get the Levels window where some sliders are moved to achieve a black silhouette on a white background. This step can be set so that it requires user input if that's necessary. But I usually manage to get a good mask automatically. The last thing is to invert the image so that we get a black background and a white guy silhouette. That's it.
This is the mask that is then applied to the layer, and the background gets filled with white. It doesn't have to be white, it can be any color, because this is the great advantage of the chroma key technique – you can change the background to any color. What this action does is get rid of the green, while preserving the image opacity. Overall, this is a quick method that allows you to replace the green background with white or whatever color you need. But the result is not perfect.
There might be some green reflexes left or you isolation might suffer because of that. When the model stands too close to the screen, it's highly likely that you'll encounter the notorious green spill.
As you can see, chroma keying is not just about background removal. There will be probably green color casts everywhere. How to deal with them? You can access the Hue/Saturation window, find the Greens in the dropout menu and decrease Saturation to -100 to get rid of all the green color that's left. But if you do that in RGB mode, it will also make the greens darker, and it will look ugly. Switch to the Lab mode if you need to desaturate the greens, and the result will be much better. But that's not the only problem you will probably encounter.
If there's something green in the image that's not supposed to be removed, you'll have to bring it back. And what about the edges? Your mask won't probably be perfect, and if you used the Levels sliders too much, it will affect the edges of your mask, it will get you a sharp edge. You can blur it by using some filter, like the Median or Gaussian Blur on the mask, or better use Select&Mask interface which is better suited for this purpose. You might also need to work on your mask with a black and white brush to make sure there are no holes. Sounds like a lot of work for something as simple as isolation.
I don't see a reason why product images cannot be shot on a white background instead if white is what we need in the end. Chromakey allows some pretty cool things to be done – like isolating hair perfectly if you tweak your mask well enough. But when you apply it to online store images, it is more troublesome than just shooting on a plain gray background. In catalogue retouching, we get to work with all kinds of colored items. There are green clothes in the market and the chroma key technique will just rip them apart.
Automatic isolation can be done more easily than that on any uniform plain background, and green reflexes do not look great on products anyway. So even if it sounds like a great idea when you hear about it for the first time, actually dealing with the chroma key images can be a rather discouraging experience. Personally, I dislike it so much that it's hard to imagine I could voluntarily agree to work with it at all. Not because I can't, because it makes things so much easier if you shoot on the background of the same color and tone to what you desire in the end. There's no need to reinvent the wheel here.
But it seems that some photographers love their green backdrops and even if you work in catalogue retouching only, you can still encounter this whole chroma key story. That's why I've made another action that deals with the problem more thoroughly and efficiently. Let's see how it works.
Let's do some more testing of my chromakey isolation action. This image is a bit better than the previous one – at least the green screen is brighter. But if I zoom in you'll see that there's a green color cast on the guy's hand. Now it's a good time to try the second action, the one that is called “Chromakey_isolation_plus”. It's based on the first action, so it converts the image to the Lab color mode as well and it does all the blending in the same way. But not just that. It also gives you quite a few prompts that let you achieve better isolation as a result. The first prompt is inevitable – it's there because the image has layers and we're changing its mode to RGB from Lab. Every time you do something like that on a layered image and Photoshop goes hysterical. I wish there was a way to just set it up somewhere, but well, it's not hard to press a button. Say “Don't flatten”, otherwise, it won't work as intended.
Pay attention to the fact that the image has changed. While still in the Lab color mode, the action has accessed the Hue/Saturation panel and reduced all the greens saturation to minus 70 or something like that. It's very important to do that in Lab mode because in RGB it's really sideways. If I did the same in RGB, the background would turn dark, and we don't want such a change to occur.
So, after changing the image mode back to RGB, the action does all the blending and merging, and when the mask is almost ready, it gives you a Levels prompt. Here you need to achieve a good, dense, solid black solid white image. Where it's black, it will be masked. Where it's white, it will be visible. Move the sliders to the center and don't forget about the middle slider. When you're done, press OK.
It's often necessary to move the sliders really close to the center to get a dense enough mask. But when you do that, you get rough edges as well. And it's really bad. But don't worry, there's the Select&Mask prompt to help you deal with that. You can use the Smooth and the Feather sliders to make the edges nice and soft. 3 to 6 in the Smooth and not more than 1 in the Feather usually does the trick.
If there's a dark rim around the model, use the Shift Edge slider to get rid of it. That might make holes in the image appear, and if that happens, you can fill them up with the Brush Tool. But it's a slow tool, so if you don't feel like waiting, you can later use a regular Brush directly on the mask. That's pretty much it.
Now the only thing that's left is to make sure there's nothing missing on the model. If there was something green, it would be either masked or desaturated, or both. This guy's watch was a bit greenish, and if I want to restore it, I can just grab the History Brush and use it on the image. On the image, not on the mask. Look here in the Layers panel to see what's active. Now the mask is active, so I'll click on the image and then use the History Brush on the watch.
You can also adjust the mask, just don't forget to switch to it. Erase it to reveal the original image, or add to it with a black brush. To switch to the image quickly, press Ctrl-2. To switch to the mask, press Ctrl-\(backslash). If you click on the mask icon while holding Alt, you can have a better look at the mask. All the holes inside will be more visible. But if there are some holes along the edge, we'd better see the image as well. I'll use the Eraser on the guy's hand to reveal the background. There was a green color cast here, but now it's desaturated and can be safely restored.
You can change the background color to any color you need, and that's about the only thing I love about chroma key. Well, at least with the action I don't need to waste a lot of time, and what's even better, I don't need expensive plugins.
Is it possible to preserve fine details? Sure, but only if the background is well lit. I'll run the action on this image with the kid and some soap bubbles. At the Levels prompt, I'll pull the sliders apart and leave the center slider at its initial position. At the Select&Mask prompt, I'll set Smooth and Feather to zero and shift the edge outward with the respective slider by moving it to the right to let's say 25%. There you go. It's not really visible on white, but if I change the background to black, you'll see the result.
Impressive, huh? Well, not exactly. Everything has its price. We've managed to preserve bubbles, but the background is not really well isolated. Have a look at the Info panel while I drag the mouse around. If the isolation was perfect, it would be 0.0.0. all the time, but it's not as black as it seems, especially down there, where the background wasn't well lit. But still, it's a good thing to be able to remove the green without using the Magic Wand or the Select Color Range, which are probably the worst tools for the job.
The Lab color mode has everything you need to deal with chroma keying, and the best thing about it is that it lets you record all the steps in an action.
Once again, I want to underline that chroma key green screen is not a good option for catalogue photography setup. It was designed for background replacement, and if you need to replace a background instead of just of filling it with a solid color, that's your best choice. When I say “replace a background” I mean a complex background, or any situations when you don't know which background color will be used. That's when you need a clearly isolated object on a separate layer – just like in transparency isolation.
In product image retouching, complex backgrounds are either avoided or used in the photo shoots for real, like when they shoot in a real room interior. Most of the time the background is just a white or light gray solid color filled area, or just plain white paper or plastic if we don't isolate it. It's never dark and it's unlikely that we'll ever want to change it from solid color to some textured pattern. And it's much easier to shoot on a plain background and later isolate it with little effort than to face all the chroma key side effects like the green spill and/or holes in your objects and clothes. Not mentioning the fact that a bright and saturated green screen in all the images is hell for anyone's eyes, and you can't really color correct when all you do is stare at something saturated like that.
If you work with chroma key, you'll find the action that I've managed to put together useful. So if you really have to edit green screen images, you can at least do most of the work with an action. That is if the imagery is not too poorly shot, in which case you'll regret your profession choice.
The actions described in this article are available in the shop. They are free for Mindful Members.
You can download the image for practice purposes from the gallery above. Just click on the thumbnail to open it in a separate window. You can right-click and "Save link as…" to download the image without having to open it first.