1

I would like to extract out the icon in the following screen (mixed with gray background)

enter image description here

to

enter image description here

Anyone know how I can do that using GIMP?

Thanks.

3
  • Just out of curiosity, where is this image from anyway? I'm wondering why you don't have the original source images to work from and are trying to "reverse engineer" the design.
    – jhocking
    Apr 11, 2011 at 14:22
  • I swear. I am not doing anything bad :) This is a logo designed by one of the contributor of a few year back open source desktop project. Recently, I want to use it for another open source android project. Since I no longer able to keep in touch with the previous contributor, I need to do some "reverse engineer" on my own. Apr 11, 2011 at 17:22
  • 4
    I am a little confused: how did you post the extracted image you want without first extracting it?
    – horatio
    May 6, 2011 at 14:18

2 Answers 2

5

Personally, I would rebuild the image from scratch because I find it frustrating not to have original source files. But, until you or someone else gets around to doing that, here's the non-destructive quick fix:

  1. d (changes default fg/bg colors to black & white)
  2. CTRL+SHIFT+n (create new layer) press OK/enter
  3. SHIFT+b (selects the path tool)
  4. Roughly outline your desired image with the path tool: It works like connect-the dots kinda... click once on your image and then click elsewhere and it creates a straight line. Let the lines clip rounded corners for now. Close the path by going around until you get back to your starting point (click on it).
  5. Improve the outline First fix the straight edges. zoom in (shortcut: +) super close so you can see better. Click and drag the dots to get the lines where you want them. (zoom out is -)
  6. Finalize the outline Now fix the curved edges. zoom in (shortcut: +) super close so you can see better. Make sure "polygonal" is unchecked in the toolbox (CTRL+B if the toolbox isn't there). Now you can click on the lines between dots and drag it to make it curved.
  7. Convert the path to a selection Hold down shift and click selection from path in the toolbox (CTRL+B if the toolbox isn't there).
  8. Menu->Layer->Mask->Add Layer Mask and choose "selection", make sure the image layer is selected (everything you don't want is now hidden!)
  9. Fix anything you don't like just click on the paintbrush (p) and paint black on the mask to hide things you don't want, or paint white on the mask to show things you accidentally hid.
  10. To maintain transparency, make sure you save as a png (for production use) in addition to saving the original GIMP file (for future editing).
1

Unfortunately it is never perfect to extract elements out of a raster image. Others will hopefully chime in with the best way to accomplish it in GIMP, but do note that for various reasons (especially anti-aliasing, which smooths out lines by blending pixels on the edge of the line with the background) any attempt to select part of a raster image and delete the rest will always result in either a ragged stair-stepped edge or an ugly halo of the background color.

In this case I would use a layer mask to remove parts of the image. The free select tool with polygon snap (polygonal lasso tool in Photoshop) can be used to paint black/carve off straight sections from the right side of the image, and then use the fuzzy select tool (magic wand in Photoshop) to get around the tricky gaps in the top-left. Not perfect though.

For this reason you always want to keep the original image with either intact layers for later modification or as a vector illustration.

2
  • In order to " ... delete the rest ..." you should really use layermasks. They are magic. You can delete and recover bits of your original image just by painting black or white. This is crucial when you wish to get close to the edge of the object. Working with relatively soft brushes could help you get an acceptably antialiased border.
    – leugim
    Apr 9, 2011 at 22:21
  • good point, I'll amend my answer
    – jhocking
    Apr 9, 2011 at 22:54

Your Answer

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

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