I took a screenshot of a character from a game I'm playing, with a mod that adds blocks for chroma keying. What I'm stuck on is that even though the image has no shadows (fullbright enabled for the screenshot), using the color tool will always leave too much of my background in place, or remove parts of the subject. I want to remove every pixel with certain color values from the image, without removing anything except those pixels. Is there a better way to do this than the color tool?
The color and fuzzy selection tools are both "binary": pixels are either fully selected or not selected at all. At the same time the pixels at the edge of things are a blend of the two colors (subject and background), so they aren't exactly the same color as the background. When you use that to remove a background you end up with either pixellated edges (threshold too high) or a halo of the initial background (threshold too low).
What you really want is replace the background color by transparency, and make pixels of intermediate colors partially transparent.
The right tool for this is Colors>Color to alpha. To avoid applying C2A to areas inside the subject that could have a color close the background one, a good technique is to:
- Fuzzy-select the background with a normal threshold.
Select>Growthe selection so that it includes the edge pixels. 1px is sufficient if the image is clean (no JPG artifacts) but iusing 2-3px should be OK.
Colors>Color to alphaand remove the background color
Add an alpha-channel to the layer first if it hasn't got one already.