Page 1 of 4 1234 LastLast
Results 1 to 20 of 68

Thread: Lesson 2 - Removing the Background

  1. #1
    Domesticus
    Artifex

    Join Date
    Jul 2009
    Location
    The north
    Posts
    2,411

    Default Lesson 2 - Removing the Background

    Lesson 2 - Removing the Background
    On this second lesson we'll study how to remove the background from an image. In other words this means making the background transparent. The transparent area will be of the colour of the message board, for example, to which you'll post your image.

    There are several ways of removing the background but we'll study only two of these. Those two are the easiest and most common ones: Color to Alpha and the Free Select Tool. This lesson isn't very difficult either, but this is a skill you need very - I repeat: very - often, so it will certainly be worth it studying it properly.

    Background removal is often needed for example for avatar-making - the Internet is full of great pictures, but many of them have an annoying (usually white) background. Unfortunately there's not a single, quick way to remove it.

    I know this lesson may be a bit boring but the content is very important, so don't underestimate it. From Lesson 3 on we'll start the interesting part of this course and you'll really get to use your imagination and creativity!

    Techniques
    • Using the Color to Alpha function
    • Cutting objects by using the Free Select Tool
    • Using the Alpha channel
    • Quick zooming
    Color to Alpha

    This feature of GIMP may sometimes turn out very useful. Not only can you remove the background by using this but you can for example decrease the amount of black an image contains. However, to enable you to use this technique for removing the image background the image basically needs to have only a few colours - the best combination being black and white, although it's possible with other colours as well if they're quite different (as it comes to the RGB, or Red-Green-Blue values they have) from each other and the background is basically of only one colour. Apart from that using this technique is very simple.

    Pretty much the same thing we'll do here could also be done with the Fuzzy Select Tool, but using it is so simple that I will not teach you how to do it.

    Well, for this part I have decided to remove the white background of the following picture:
    Click to view content: 

    Step 1

    First I increase the contrast of the image to make sure that absolutely none of the background will be visible after I've changed white to "Alpha" which is the synonym of "transparency". This step may always not be needed:
    Click to view content: 

    Step 2

    Now simply click Colors and then Color to Alpha. In the dialog at the bottom left you can select the colour to be turned into Alpha. Notice that in the "Color to Alpha Color Picker" there is a button in the bottom right corner - just above "Cancel" - that allows you to choose the colour by clicking on anywhere in the preview window.

    Now just select white and click "OK":
    Click to view content: 

    Now you can see only darker and brighter grey squares where earlier was white. The squares represent the transparent area (or Alpha channel). When you have saved the image it will look like this:

    Click to view content: 

    The Free Select Tool

    Before you start completing this section you have to adjust your GIMP preferences in a certain way in order to make the transparent layer trick (Step 4) work. To do this you have to open GIMP, select Edit > Preferences > Default Image and then Advanced Options > Fill with > Transparency. Then close GIMP and re-open it.

    This tool is one of the GIMP tools you'll need the most. It can be used for practically anything - your fantasy is the only limit, to put it out poetically. For example those who enjoy editing TW screenshots use this tool all the time. As its name says, it is used for making free selections.

    Okay - what do I need these free selections for? Well, of course for removing the background. But what else?

    It can be used for example to edit a certain part of the image (with filters for example - usually they affect the whole image/layer) without touching the other parts. A useful trick is to make a new layer and fill the selection with black. Then you can turn the layer invisible. When you need to, you can select the black area (this will be learned on the third lesson) without having to remake the selection.

    I'll remove the background from this picture of a guy I think I've seen somewhere...
    Click to view content: 

    I have earlier copy-pasted this image from web to GIMP - to do this you have to open GIMP and then just press Ctrl + V. GIMP will automatically create/open the image. Before you start working on the image you should save it as PNG (or basically in any file format that supports transparency) - otherwise you'll be facing problems with the latter part of this section.

    Step 1

    Select the Free Select Tool in the Toolbox. The mode (see the tool details under the Toolbox) is by default "Replace the current selection". The other modes are "Add to the current selection", "Subtract from the current selection" and "Intersect with the current selection", but you don't have to care about them at this point. Now, make sure the default mode is on and start clicking along the outline of the guy - those funny dots will start appearing. They are the selection anchors; once you're ready the selection outline will go along the line between two dots, from dot to dot. You can also "draw" the selection outline with this tool. That may be particularly useful for round parts of the selection line. Also, you should zoom in by holding down the Control button and scrolling with mouse.
    Click to view content: 

    (Sorry, I had accidentally left the Layer menu partially outside of the picture before taking the screenshot.)

    You can also drag the mouse to draw the selection outline.

    When you go wrong (I'm quite sure you will - that happens to me all the time) press the Backspace button (the one above Enter if you didn't know) to remove the latest dot.

    Step 2

    Now just continue clicking. Identifying the border of an object and the background can sometimes be difficult, but in this case you don't have to make it perfectly.
    Click to view content: 

    Step 3

    When you're ready (you have surrounded the object with dots) just click the first dot again to connect the last two dots, and all the dots will turn into a selection. I have selected the warlord (I recall he's a vision of William the Conqueror) here, as he is inside my selection. Alternatively you can select the background by going around the image the other way round (above the image).
    Click to view content: 

    Step 4

    Now, because I had saved the image before starting, the image hasn't a transparent background. That's why I'll create a new transparent layer by right-clicking the Layer menu and then left-clicking "New Layer" (or simply by using the shortcut: Ctrl + Shift + N)...
    Click to view content: 

    ...and put it under the layer on which I have the guy by pressing the green arrow that is pointing down:
    Click to view content: 

    Now I have a transparent background.

    Step 5

    Now I'll select the "guy layer" (the original one) by left-clicking on it in the Layer menu, and right-click on the image. This opens a quick menu. At the moment I have the warlord as my selection, but I actually want to remove the background. That's why I now click "Select" and then "Invert":
    Click to view content: 

    Step 6

    Now that you have the background as selection just start erasing the background with the Eraser Tool:
    Click to view content: 

    When you have erased the background the image should look like this:
    Click to view content: 

    Now I have a pretty good so-called render:
    Click to view content: 

    And this was lesson number two! I could have removed the background a little more carefully by using for example the Eraser Tool with 50 % opacity and setting it to small scale. However, that is more of an intermediate technique and this render is good enough for my purposes...


    Homework
    Use both of the two techniques I have taught above to remove the background from two images (one image per technique - if it's necessary you can of course mix them). I highly recommend picking your own images because you can use the renders on the next lesson to create your very first avatar! If you're absolutely not interested in that, here you have some pictures to use:
    Click to view content: 


    You can try to remove (by using Color to Alpha) the blue and yellow from this picture:





    And here two tough ones (basically hair is always difficult to cut, so that Mr. Bean photo could be a toughie as well):





    Please post your results with the original images (again if you used other than those above) in this thread by Saturday the 12th of May.

    Tips
    • Zooming by holding down Control and scrolling with mouse will make your work dramatically easier
    • Select your render wisely - on Lesson 3 you can use it for making your first avatar
    • Basically the bigger the image the easier it will be to remove the background with the Free Select Tool (and the bigger the render you'll get)


    Lesson passed
    Last edited by Goofy; July 09, 2012 at 10:20 AM.

  2. #2

    Default Re: Lesson 2 - Removing the background

    Hi I was kinda bored so I decided to try some more than two

    Original:
    Spoiler Alert, click show to read: 


    Edited:
    Spoiler Alert, click show to read: 


    Original:
    Spoiler Alert, click show to read: 


    Edited:
    Spoiler Alert, click show to read: 


    Original:
    Spoiler Alert, click show to read: 


    Edited:
    Spoiler Alert, click show to read: 


    Original:
    Spoiler Alert, click show to read: 


    Edited:
    Spoiler Alert, click show to read: 


    Original:
    Spoiler Alert, click show to read: 


    Edited:
    Spoiler Alert, click show to read: 
    Last edited by ForteS; May 08, 2012 at 01:36 PM.

    UNDER THE MOST HONORABLE PATRONAGE OF: Legio!
    PATRON OF: Wangrin, ♔Sir Digby Chicken Caesar♔, Geronimo2006 and Narf!

  3. #3
    Shankbot de Bodemloze's Avatar From the Writers Study!
    Citizen

    Join Date
    Dec 2011
    Location
    Midlands, UK
    Posts
    14,834
    Blog Entries
    2

    Default Re: Lesson 2 - Removing the background

    Hey Teach,

    Number 1.)
    Spoiler Alert, click show to read: 

    Number 2.)
    Spoiler Alert, click show to read: 


    I know there not avatar size, but they can be resized Also about them being the same image - I wanted the same, but in different 'poses'

    How I did well, I tried the alpha for the first one. However, for the second one I tried the selection method - it worked up until a point, when I tried erasing the 'not-needed' bits (after creating the transparent layer) it just erased to white, not transparent. So I simply used the alpha technique when the background was right. Any ideas?

    Last edited by Shankbot de Bodemloze; May 10, 2012 at 12:44 PM.
    THE WRITERS' STUDY | THE TRIBUNAL | THE CURIA | GUIDE FOR NEW MEMBERS



    PROUD PATRON OF JUNAIDI83, VETERAAN & CAILLAGH
    UNDER THE PATRONAGE OF MEGA TORTAS DE BODEMLOZE

  4. #4
    TheDarkKnight's Avatar Compliance will be rewarded
    took an arrow to the knee Content Emeritus spy of the council

    Join Date
    Oct 2010
    Location
    The good (not South) part of the USA
    Posts
    11,632
    Blog Entries
    12

    Default Re: Lesson 2 - Removing the background

    I'll do this once I get back to my room. I can't do this in class without a mouse
    Things I trust more than American conservatives:

    Drinks from Bill Cosby, Flint Michigan tap water, Plane rides from Al Qaeda, Anything on the menu at Chipotle, Medical procedures from Mengele

  5. #5
    Beorn's Avatar Praepositus
    Join Date
    Jan 2009
    Location
    Athens
    Posts
    5,327

    Default Re: Lesson 2 - Removing the background

    Accidentally, (in the free select tool) I pressed enter instead of backspace, and the last circle I had made was connected with the 1st one. Is there any way to undo this? I don't want to go through this pain all over again...

  6. #6

    Default Re: Lesson 2 - Removing the background

    How I did well, I tried the alpha for the first one. However, for the second one I tried the selection method - it worked up until a point, when I tried erasing the 'not-needed' bits (after creating the transparent layer) it just erased to white, not transparent. So I simply used the alpha technique when the background was right. Any ideas?
    Same thing here! Did exactly what he did, but when I erase I get a white background! Once I tried the Alpha technique it worked so its not a problem.

  7. #7
    Shankbot de Bodemloze's Avatar From the Writers Study!
    Citizen

    Join Date
    Dec 2011
    Location
    Midlands, UK
    Posts
    14,834
    Blog Entries
    2

    Default Re: Lesson 2 - Removing the background

    Quote Originally Posted by Beorn View Post
    Accidentally, (in the free select tool) I pressed enter instead of backspace, and the last circle I had made was connected with the 1st one. Is there any way to undo this? I don't want to go through this pain all over again...
    Not to state the obvious or anything, but couldn't you just click 'undo?
    Quote Originally Posted by The Norseman View Post
    Same thing here! Did exactly what he did, but when I erase I get a white background! Once I tried the Alpha technique it worked so its not a problem.
    Glad it's not just me!
    THE WRITERS' STUDY | THE TRIBUNAL | THE CURIA | GUIDE FOR NEW MEMBERS



    PROUD PATRON OF JUNAIDI83, VETERAAN & CAILLAGH
    UNDER THE PATRONAGE OF MEGA TORTAS DE BODEMLOZE

  8. #8
    Beorn's Avatar Praepositus
    Join Date
    Jan 2009
    Location
    Athens
    Posts
    5,327

    Default Re: Lesson 2 - Removing the background

    when I click undo it erases the whole free select thing. when I hit backspace it does nothing. Anyway, I'll do the whole process again.

  9. #9

    Default Re: Lesson 2 - Removing the background

    Original:


    Spoiler Alert, click show to read: 





    With GIMP:

    Spoiler Alert, click show to read: 




    About the second method, do you know why it happened to me and Shankbot? The background turning white instead of that background you got?

    EDIT: Figured it out!

    Original:

    Spoiler Alert, click show to read: 


    With GIMP:

    Spoiler Alert, click show to read: 
    Last edited by The Norseman; May 08, 2012 at 03:23 PM.

  10. #10
    Domesticus
    Artifex

    Join Date
    Jul 2009
    Location
    The north
    Posts
    2,411

    Default Re: Lesson 2 - Removing the background

    If you accidentally press Enter and the selection gets confirmed, you can set the Free Select Tool to the "Add to the current selection" mode and then continue your work (this time starting where the selection ends).

    This tool can really be a pain at first, I know, but it'll become your friend when you start getting the hang of how to use it properly and get some experience.

    @ForteS: Top-notch work! And nice to see that you tried out them all!

    @Shankbot12: Good work. For avatars, however, you should choose a render which is complete - your first one is unfortunately cut on the right. And in your second image you might want to remove those leftovers of the background.

    @The Norseman: Great, now just do the second one as well!
    Quote Originally Posted by Shankbot12
    when I tried erasing the 'not-needed' bits (after creating the transparent layer) it just erased to white, not transparent. So I simply used the alpha technique when the background was right. Any ideas?
    Did you make sure that the transparent layer is under the non-trasnparent one?

    Another way to avoid this is to create a new image with a transparent background (you'll have such an option when you're creating an image) and then paste your desired picture to it. After that you can crop what is spare.

    Ah, I just read The Norseman's first post and got the point - you must first set your GIMP preferences so that GIMP creates all images with a transparent background by default! You can do that by opening GIMP and then selecting Edit > Preferences > Default Image and then Advanced options > Fill with > Transparency. My apologies for this, I'll update the OP so that others won't face the same problem you did.
    Last edited by Goofy; May 08, 2012 at 02:50 PM.

  11. #11

    Default Re: Lesson 2 - Removing the background

    Ill try it out! Lol its hard for me sometimes because my GIMP is in my language

  12. #12
    edse's Avatar Domesticus
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    2,293

    Default Re: Lesson 2 - Removing the background

    Still the same for me, it erases to the current background colour. Even when I crop it does this.

  13. #13
    Beorn's Avatar Praepositus
    Join Date
    Jan 2009
    Location
    Athens
    Posts
    5,327

    Default Re: Lesson 2 - Removing the background

    here's the 1st one:
    Spoiler Alert, click show to read: 


    edit: here's the original
    Spoiler Alert, click show to read: 

  14. #14

    Default Re: Lesson 2 - Removing the background

    Uhm ok I checked again and did what you said but somehow the background still goes white when I erase it...

  15. #15
    TheDarkKnight's Avatar Compliance will be rewarded
    took an arrow to the knee Content Emeritus spy of the council

    Join Date
    Oct 2010
    Location
    The good (not South) part of the USA
    Posts
    11,632
    Blog Entries
    12

    Default Re: Lesson 2 - Removing the background

    Quote Originally Posted by The Norseman View Post
    Uhm ok I checked again and did what you said but somehow the background still goes white when I erase it...
    Me too
    Things I trust more than American conservatives:

    Drinks from Bill Cosby, Flint Michigan tap water, Plane rides from Al Qaeda, Anything on the menu at Chipotle, Medical procedures from Mengele

  16. #16

    Default Re: Lesson 2 - Removing the background

    Ok, for those of you who have problems with having a white background when erasing, the solution is quite simple. Once you have marked the picture like here:

    Spoiler Alert, click show to read: 





    Press Ctrl + X, then make a new layer as shown on the picture above and paste the picture you have
    now cut, into the new layer. Then you will have the right background and the picture is finished when saving it. It worked for me!
    Last edited by The Norseman; May 10, 2012 at 08:23 AM.

  17. #17
    Vağarholmr's Avatar Archivum Scriptorium
    Content Emeritus

    Join Date
    Oct 2010
    Location
    In the valley
    Posts
    5,588

    Default Re: Lesson 2 - Removing the background

    Originals
    Spoiler Alert, click show to read: 




    My
    Spoiler Alert, click show to read: 





    The borders are not very accurate, thats because i am tired
    {I cook weird stuff}-{Patronised by the fearsome Chloe}
    „[...] şví ağ meğ lögum skal land vort byggja en eigi meğ ólögum eyğa.“
    (The Frosta-thing law, 1260)

    Is acher in gaíth innocht,
    fu-fuasna fairggae findfolt:
    ní ágor réimm mora minn
    dond láechraid lainn ua Lothlind.

  18. #18
    King William the Conqueror's Avatar Campidoctor
    Join Date
    Jun 2011
    Location
    At my Computer
    Posts
    1,553

    Default Re: Lesson 2 - Removing the background

    Quote Originally Posted by The Norseman View Post
    Ok, for those of you who have problems with having a white background when erasing, the solution is quite simple. Once you have marked the picture like here:

    Press Ctrl + X, then make a new layer as shown on the picture above and paste the picture you have now cut, into the new layer. Then you will have the right background and the picture is finished when saving it. It worked for me!
    Thanks. This is a huge help
    I hold the blitz record for Medieval II (106 region in 7 turns) set in January 2024.

    Check out my Youtube Channel: CosmicConqueror
    Proud Member of TWC since 2011!

  19. #19
    Raritу's Avatar Glück auf!
    Artifex

    Join Date
    Aug 2010
    Location
    Veltins Arena
    Posts
    2,464

    Default Re: Lesson 2 - Removing the background

    Oh I love this lesson

    This one for the fabulousity
    original


    Yeah, I take an icon image. This posse is excellent, however I can't find the original one.

    edited



    This one because I like Bean.
    original


    edited



    Edit: Forgot the first technique:
    original



    edited


    Edit 2: I feel so confused right now
    Last edited by Raritу; May 08, 2012 at 10:12 PM.
    Honored filly of M and happily taking my glance over Milner and Diamat

  20. #20
    King William the Conqueror's Avatar Campidoctor
    Join Date
    Jun 2011
    Location
    At my Computer
    Posts
    1,553

    Default Re: Lesson 2 - Removing the background

    Here is my work:
    Penalty

    1st image

    2nd image


    EDIT: I have no idea why there is that red line around the penalty
    I think it is a imageshack problem because this screenshot proves that it looks fine in GIMP.
    Spoiler Alert, click show to read: 

    I also have no idea why the Color to Alpha does this....
    Spoiler Alert, click show to read: 

    please help!
    Last edited by King William the Conqueror; May 09, 2012 at 08:16 AM.
    I hold the blitz record for Medieval II (106 region in 7 turns) set in January 2024.

    Check out my Youtube Channel: CosmicConqueror
    Proud Member of TWC since 2011!

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •