0

I've been designing some custom backgrounds for a game recently, although I have little to no skill with photo editing. I've usually only used MS paint, but this particular project required tools that I could only access (for free) through the Gimp editing software.

I've no skill with Gimp, and while a lot of the functions were ridiculously useful, most of the time I'm just confused and lost in all the different tools and values. So, for a particular element of my design, I decided to export my project to a png file and do some tweaking in good ol' MS Paint.

The element consisted of black and white, and so I used a red background because I thought the sharp contrast would make it easy to remove later on. After finishing on paint, I opened the file in Gimp, pressed Select > By Color, and selected the red background. After deleting the background, I saw that there was a layer of red all around the remaining elements.

I tried increasing the threshold, but then it selects bigger parts of the element as well. It's the same issue with the magic wand tool. I don't seem to be able to cut my element away from the background. Are there any tools in gimp that could help me? Its all still greek to me, and playing around with the different functions was, unfortunately, no help.

1
  • 1
    Hi. Welcome to GDSE. Please share an image to show what you are trying to achieve, and possibly also the original image you started with. It's almost impossible to answer without something visual.
    – Billy Kerr
    Feb 18, 2019 at 23:52

2 Answers 2

0

The red halo occurs because the edge of things is made of pixels that are a blend of the background and the subject colors. Depending on threshold fuzzy-select either selects them fully (jagged edges) or not at all (halo).

The right solution is to use Color>Color to alpha to replace the backgroud by transparency (so that you get edge pixels that are partially transparent where needed).

If your background is of a very different color from the rest, use Color>Color to alpha and sample your background color to remove it, without using any selection.

If this leads to some parts that turn partially transparent, the procedure is slightly longer:

  • Fuzzy-select the background
  • Select>Grow the selection so that it includes the edge pixels (normally, one or two pixels are enough)
  • Colors>Color to alpha

In Gimp 2.8, Color-to-alpha adds and alpha channel automatically if there is none, in Gimp 2.10 you have to make sure there is one before using Color-to-alpha.

0

Not asked, but painting on red when only the painted items are needed sounds obscure. Consider to start a new image with a transparent background - it's in the advanced options in the new image dialog.

If you have already worked a good amount with no transparency you can do as already suggested: insert the alpha channel and turn the red to transparency with color to alpha.

Another possibility - in case your wanted image has only black, white and gray - is to turn your unwanted remnant - the red halo - to grayscale by desaturating the image. If you use color to BW mixer you can give to the red halo also just the wanted brightness.

You can select red exactly only if it's not mixed with other colors. The mix doesn't happen if one draws with a solid brush with no anti-aliasing nor blur effects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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