Chroma key with GimpPosted: October 11, 2011
So, suppose, you want to use the bluescreen (aka greenscreen) technique to create some composite photographic images. The technique, as you well know, involves shooting objects in front of a screen of a certain uniform color (normally blue or green) and the computer method, referred to as the chroma keying, to deal with the bluescreen images in postprocessing.
It can be done in Gimp pretty well.
The easiest method, of course, is just to use the “Select/Select by Color” function and delete the “transparent” color. But if you want to make it a little bit more sophisticated, you can go ahead as described below.
For this you need to have the GAP (GIMP Animation Package) installed. If you don’t currently have it, you can instantly get it by using command:
sudo apt-get install gimp-gap
Now, let’s have a look at one of the many ways this can be accomplished! Load your bluescreen image into GIMP and proceed as follows:
1. Layer/Transparency/Add Alpha Channel : Make it possible for the image to be transparent.
2. (Optional) Layer/Transparency/Color to Alpha; pick the most typical color of the background to be removed; then undo the operation : The reason for this is that all we want is to store the value of the backgound for later use in the (optional) Step 5.
3. Video/Bluebox : Remove all or most of the background.
Switch to VALUE (!)
Click eydropper icon bottom right and click at your image at the spot where the background color, which you want to remove, is the most typical
Ok your way out.
If the result is not what you expected, either undo and repeat picking the background color from another spot, or proceed to the next step.
4. Video/Bluebox : Remove the remaining patches of the background. Repeat until all background is clean.
5. (Optional) Layer/Transparency/Alpha to Selection; Select/Invert; Select/Grow by few pixels (maybe 1 to 5, it depends on the image); Layer/Transparency/Color to Alpha : Dissolve the remaining background outline around the object edges. Don’t overdo it, as it destroys the color balance in the affected area. You have to decide yourself in your particular case if this step provides more benefit than damage. It seems to be very much dependent upon the colors in your image and the future background. Skip it, if it makes matters worse instead of improving them.
6. (Even more optional) Layer/Duplicate layer; Filter/Blur/Gaussian Blur : Soften the object edges to prevent them from looking unnatural (see the detail at the bottom of the page). The particular value for the blur filter depends on your image, especially the size of it. Also, normally you would skip this step in small sized images, as the effect there is not obvious.
Then move the blurred layer under the original layer, like this:
The job is complete!
This is the final image on a simple black background.
Here in this detail you can see the difference between an image which has had the edges softened as opposed to the one that hasn’t.