Skip to page content or skip to Accesskey List.
Search evolt.org
evolt.org login: or register

Work

Main Page Content

Separating an object from its background

Rated 3.64 (Ratings: 13) (Add your rating)

Log in to add a comment
(21 comments so far)

Want more?

 
Picture of pegaweb

Daniel Piechnick

Member info | Full bio

User since: October 12, 2002

Last login: October 12, 2002

Articles written: 1

I've seen people try to separate an image from its background by using the Pencil tool, by playing with the Magic Wand, and even by trying to draw an outline with the Lasso tool.

The main difficulty with trying to separate an image from its background is that there are pixels which cover an area of the picture which is partly foreground and partly background. With any of the aforementioned methods, you have to declare whether a pixel is either foreground or background, even though it may be both.

Believe it or not, there is a way that you can cut pixels in half. In Photoshop, the way it works is that if you cut a pixel in half, you'll have the same pixel, but it will be 50% transparent, so it will be affected by what colour you put under it, just like the difference between coloured paper and cellophane.

Step 1: Select the Freeform Pen tool (click and hold down on the fountain pen-shaped tool.)

Step 2: Draw a rough outline around the object. Generally err on the side of cutting into the image rather than leaving a gap.

Use Ctrl+Click to manipulate the points, and drag their "arms" around to change the curve. To insert a new point, just click on the line.

When you've finished, right-click the line, and click Make Selection. This turns your line into a selection.

Step 3: Cut out your object and paste it into a new layer. You can then replace your background layer with whatever you want.

I've put in this magenta (opposite of green) background to show up any green bits that might still be stuck to our budgie.

Notice there are no jaggy edges, and there is no visible green outline.

Excellent article

Submitted by ghurtado on October 23, 2002 - 09:53.

Extracting images from the background is probably one of the top issues begginer Photoshop users have... this article addresses that need very well.

login or register to post comments

missing a few things....

Submitted by nagrom on October 23, 2002 - 10:07.

I assume we're dealing with Photoshop 6 or 7 here. It's worth pointing out that the lack of jaggies in the final image are because photoshop is applying a feather for you. In older versions such as 5, you must apply a 1 pixel feather to your selection, or you WILL get ugly jaggies. Another word for the feathering, is anti-aliasing. This step is usually required in other graphics programs.

Also, I think a little more detail concerning good curve drawing technique would be in order here. Pulling the arms of the curve points is usually an exercise in frustration. Many people don't realize that with the arrow tool, you can pull the curve itself, which will get you much more accurate results in half the twiddling-time. The fastest method, is to lay your points around the image you're outlining, pulling the initial curves only a teeny bit, so that the arms point in the general direction of the curve. This will result in a rough cut, that can be very quickly cleaned up by pulling the curves themselves.

login or register to post comments

Masking for me

Submitted by somenice on October 23, 2002 - 12:52.

I sometimes find using a mask makes for the easiest extraction. Swapping between Black and White (x) during the masking process is quick and the quantity and sizes of brushes allows for different outlines. I usually keep a couple different bg layers both dark and light to get better edging. I also suck with the pen tool.

login or register to post comments

Masking and Extraction

Submitted by factotum on October 23, 2002 - 15:11.

I agree with somenice that masking is a better solution for cut-outs than Mr. Piechnick's use of the pen tool. The best strategy for those users using at least Photoshop 6 is the new tool Extract available under the Image menu (always perform on a copy of the layer). The second best is Quick Mask described by somenice, available by shortcut using the 'Q' key; once masked, a selection is created (hit 'Q' again) and a feather (ctrl/cmd + alt + d) will allow to enter a feathering amount . The third best strategy is the pen tool. Remember that you can create a pen path from any selection, if for some reason you found yourself needing a path around the object. My condolensces to anyone using the lasso or magic wand to punch something out.

login or register to post comments

RE: Masking and Extraction

Submitted by glaven on October 23, 2002 - 15:47.

thanks for your condolensces factotum.

<quote>
My condolensces to anyone using the lasso or magic wand to punch something out.
</quote>

i think my background cutting days are going to be shortened from now on if you know what i mean!

good article.

you know, i was even considering today to send an email to theList about this very subject. boy would have looked like an ass or what?

chris w parker

login or register to post comments

RE: Masking and Extraction

Submitted by ghurtado on October 23, 2002 - 16:56.

I wholeheartedly disagree with factotum. While the new Extract tool can render some nice results for novice users, it lacks some of the functionality that more advanced methods (ie: pen selections) have. You will agree that you cannot "tweak" the Extract method once you have commited it the same way you can with the pen tool. I personally have found it lacking for some of the most complex images I have used it on (hard to achieve the exact result I was looking for, seems to have a "mind of its own"). For anyone with the desire to greatly enhance their background removal skills, it pays off to spend some time understanding the pen tool; sure, it can be a little frustrating as first, but the degree of control, fineness and clean shapes you can achieve with it can most definetly not be achieved with the other "raster" selection tools.

login or register to post comments

Good tip

Submitted by 4serendipity on October 23, 2002 - 20:10.

Thanks to the author and the comments. They are a great help to this photoshop-challenged reader. ☺

login or register to post comments

Jaggies? Frustration?

Submitted by spongepuppy on October 23, 2002 - 22:05.

Nagrom, I work in print design, and I can assure you that you don't need to apply a feather to paths to antialias them in earlier photoshop versions. Strictly speaking antialiasing is used to remove "jaggies" by simulating sub-pixel curve accuracy using pixel alpha, whereas a feather is a blur applied to the mask resulting from a given path curve. Checking the "antialias" box in the pen too options dialog cures your "jaggies" in PS 4 and 5.

Another helpful option that nobody seems to know about is the "rubber band" ckeckbox on the pen tools option palette - beginners often find it helpful, as it draws a preview of the current path segment as you move your mouse. Additionally, you don't need to construct paths by drawing a rough path and then "making it fit" - it's far more productive to use modifier keys with the pen tool to access the different sub-functions while drawing (try playing with combinations of apple, option and shift - or control, alt and shift for those using real computers :3). Using these you can modify the bezier handles as you draw, generally giving a better result than drawing a rough path and then trying to tweak it into shape.

login or register to post comments

Generate Work Path a saviour, too

Submitted by spongepuppy on October 23, 2002 - 22:11.

That said, there's also a lot to be said for the "make work path" function - Photoshop can create a path from a selection. I find this helpful in the event clients actually supply photos where the background CAN be easily masked out, whereas drawing a path would be rather painful (potted palms, for instance). Having made your selection, you can make a work path by selecting the Paths tab on your control palette and accessing the little arrow contect menu. You won't want to bother using a Tolerance of less than 0.5 for the path generation either, because smaller values are invalid and larger values give wildly inaccurate results.

The results of this function are usually quite acceptable, but the paths that result usually incorporate totally bizarre points and handles, and also tend to round off pointed corners - but it's quicker than spending the rest of your natural life drawing clipping paths and can be the way to go when it's easier to draw a mask but you need a path.

login or register to post comments

programmers like to click and then pull

Submitted by nagrom on October 23, 2002 - 22:31.

i disagree that tugging a path to fit as you go is faster. maybe its just a matter of taste, but i prefer to lay my points, and then pull my paths. pulling the handles on two ends of a curve one at time is silly, when you can pull them both at the same time by grabbing the center. i guess you could do this as you go, but i think it would be less efficient (for me, anyway).

and those of using real computers (or who suffer the wrath of both kinds like myself), have access to all the menu items as shortcut keystrokes, which you cant do on the mac (maybe you can in ps7, i havent shelled out for it). all the tool switching keystrokes are also available on the pc side, so don't go catatonic if you have to use one ;)

login or register to post comments

????

Submitted by spongepuppy on October 23, 2002 - 22:51.

I'm not going to question your mode of workflow, since I can appreciate that everybody likes to do things their own way. However, the shortcut keys are available on all platforms, and are the same [barring obvious OS and platform differences], and have been so since PS4.

login or register to post comments

channels for hair

Submitted by benjer on October 24, 2002 - 02:12.

I agree totally with your article - especially poignant for print designers. The use of Make Path from selection creates numerous points and will in fact crash most RIP printers. For Web or Image manipulation you should really start learning how to use channels - they will be your best friend - many images have blurred edges and lots of hair.

A quick googling found these links:

&lt;tip type=&quot;Photoshop paths&quot; author=&quot;Benjer&quot;&gt;
When using paths it can often be difficult to go in a completely different direction. After clicking and dragging your point you can press ALT/OPTION on the point. You can then go in any direction you like.

login or register to post comments

Interesting

Submitted by spongepuppy on October 24, 2002 - 06:57.

I've not heard of any problems with RIP printers and extravagant paths - although I can appreciate that in many cases they are probably quite old, and a curveball path could bork them I suppose; I'll bear that in mind in future.

login or register to post comments

????

Submitted by nagrom on October 24, 2002 - 06:59.

spongepuppy, please enlighten me...this is one of the things i hate about the mac. how do you open the image size dialog, or rotate a picture with keystrokes on the mac? i'm not trying to be a jerk or anything, if there's a way to do it i'd really like to know.

login or register to post comments

Apologies

Submitted by spongepuppy on October 24, 2002 - 07:31.

Ahh, I apologise for creating a misunderstanding - I thought you were referring to the use of modifier keys specifically RE: the pen tool.

login or register to post comments

where there's a will there'a a way:

Submitted by benjer on October 24, 2002 - 07:42.

most people use actions to create their own shortcuts, here's a google start:

actions

login or register to post comments

actions, yes

Submitted by nagrom on October 24, 2002 - 07:59.

actions, yes, but i can't dupe the PC ones exactly....like alt+i+i to open the image sizer.

about RIPs and paths with too many points, i've seen that happen on old postscript level 1 RIPs, but a level 2 RIP can usually handle anything (unless its a huge poster thats a total mess, i guess). a good indicator of what the printer has in the RIP department is what their limitations on the job are. for instance, level 1 RIPs can't handle a picture rotated by quark (or whatever layout program). level 1 RIPs must be close to extinct by now anyway...desktop printers are another story. i have some old HP laserjets that are really fussy, and crash on big files all the time. such is life.

login or register to post comments

RE: Masking and Extraction

Submitted by factotum on October 24, 2002 - 11:06.

I think the most obvious problems with those using the extract tool is that they are a novice with this tool, not novice users as ghurtado suggests. I have used this to cut out all sorts of pen-impossible shapes, i.e. hair, glass, etc. You could spend an eternity doing that with a pen, if it could be accomplished at all. I have better things to do with my time. Now, if we're raising the bar on what is acceptable quality (i.e. print design), then other than being on the wrong website, I should also argue that you need the clipping mask in place. That gradient is better created in a non-raster application. However, since it took me about thirty seconds to cut out this falcon for acceptable web quality (from saving it to my desktop to booting Photoshop to chopping it out), I would probably say that's the best tool for the buck. In addition, if you take the time and go in, I think you'll find that you can get amazing quality. Be sure and explore the other tools on the palette. To be sure, it took me awhile to get used to the extract tool (and I was reluctant), but there's a reason this used to be a $150 plug-in.

login or register to post comments

Well, I dont know

Submitted by ghurtado on October 24, 2002 - 14:47.

Truth of the matter is, the extraction tool has brought me a great deal of frustration, and maybe there is some hidden trick to its use that I do not know about. The hardest part for me is the fact that once an area has been wrongfuly cut out by the tool, I have found no simple way to fix the problem area than to redo the whole process. Maybe you have any links on its usage that you think may be useful?

login or register to post comments

RE: Well, I dont know

Submitted by factotum on October 24, 2002 - 15:12.

Sure, a quick google gave me http://ps6.com/Tutorials/Extract/intro.html, which looks to be a great tutorial. I'm not fond of how he makes the pages work (like viewing the movies did strange things in Moz), but the info is great. I even learned some stuff quickly skimming the tute that I had before not known.

The truth of the matter is that it's not the end-all be-all solution, but because of the time it saves, I find it worthwhile to give it a quick whirl before trying quickmask. Only rarely, will I find it necessary to use the pen tool (cutting out a man-made object, for instance).

Let me also give you some quick advice: The larger the brush or 'decision' area, the better suited it is for hair, fur, etc. If you get it real tight with a small brush, you'll make a much sharper cut. Also, the same shortcuts work in extract mode, i.e. B for brush, G for fill, etc.

Hope it helps and good luck. I think you'll find it a great tool once you understand the cleanup tools.

login or register to post comments

having done this for 10 years

Submitted by wcb4 on November 13, 2002 - 08:02.

Retouching photos in the printing industry,I would be willing to lay any amount of money that I can mask an image by laying my points and dragging the handles to make the paths fit faster than ANYONE who drops all their points first and then goes back and edits to make them fit.

Bezier curves are a bit frustrating for new users especially, and even after having done it for a while, when you can get pretty predictable results, it can still seem more like "I can do it from having done it, but I can't really explain how to do it" The explanation that I read a while back that helped me the most to understand what was happening and definitely made this go much much faster was this....

  • place a point any place the curve changes visibly.
  • drag in a direction tangent to the new section of the curve (part after your point) approximately 1/3 of the distance between your current point and where you envision your next point going.

This does require that you always be looking a few inches ahead of where you are so that you can plan where your next point is so that you know how long to drag the handle.

Try laying and dragging your point simultaneously using thiese criteria. It might take a few seconds at first, but I can pretty much guarantee that within a few silhouettes, you will be masking much faster this way......

Just as a side note, some fo the folks here suggested it, but, for the example the author was using in this article, I would never had used the quick mask. It would have taken longer than the pen tool. Now..... when you have to silhouette around hair..... different story entirely..... Quick mask and then just draw on the channel and you are good to go. Although, I personally prefer to actually draw on an alpha channel that is visible (100% opacity, white), but that's just me ;-)

login or register to post comments

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.orgEvolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.