Tuesday, February 22, 2011

Gimp: Removing Solid Backgrounds

I bookmarked a tutorial that has since disappeared from the web. Don't you hate it when that happens? Anyway, this is really a tutorial for myself because it is something I do occasionally, but not frequently. Because of this, I always miss at least one step. It's not an in-depth for beginners tutorial, just a fast reminder of the procedure that I use. Again, this is geared as a reminder for me and isn't necessarily for the entire web. I'm putting it here so I can find it easily.

This is only for solid backgrounds.
  1. Make sure there is an alpha channel attached to the image: Right click original image layer > Add Alpha Channel
  2. Duplicate the original image layer.
  3. Select original image layer again > Click new layer > Select Layer Fill Type and select the color of the background in the original image layer (e.g., white, black, etc.).
  4. There should now be three layers:
    • Top layer: Copy of the original image layer.
    • Middle layer: Solid colored layer.
    • Bottom layer: Original image layer.
  5. Hide the bottom layer.
  6. Select top layer and from the top menu: Layer > Transparency > Color to alpha > OK
  7. Right click top layer: Select Alpha to selection
  8. With the top layer still selected, from the top menu: Select > Invert
  9. Select middle layer and delete (not the layer, but what is selected in the layer).
  10. From the top menu: Select > None
  11. Right click top layer: Select Merge down
That's it! You can either save it, delete the bottom layer or whatever.

UPDATE #1:

Okay I just tried this with a color other than white and it did not work. Using this image as an example, here is how it went.
  1. Make sure there is an alpha channel attached to the image: Right click original image layer > Add Alpha Channel
  2. Duplicate the original image layer.
  3. Use the color picker tool and select the color you wish to remove, in this instance it is baby blue.
  4. Select original image layer again > Click new layer > Select Layer Fill Type and select the color of the background in the original image layer (e.g., white, black, etc.) and in this instance, I selected Foreground color since that is the color I used with the color picker tool..
  5. There should now be three layers:
    • Top layer: Copy of the original image layer.
    • Middle layer: Solid colored layer.
    • Bottom layer: Original image layer.
  6. Hide the bottom layer.
  7. Select top layer and from the top menu: Layer > Transparency > Color to alpha and where it says From: pick the color you wish to remove, then select OK. > OK
  8. Right click top layer: Select Alpha to selection.
  9. With the top layer still selected, from the top menu: Select > Invert
  10. Select middle layer and delete (not the layer, but what is selected in the layer).
  11. From the top menu: Select > None
  12. Right click top layer: Select Merge down

Now for whatever reason, this is not working for this page at all. If I use the white background, it will remove the white block, but this is horrible for any other color, apparently.

No comments: