View Full Version : Complex hair selection superfrasky 01-17-2006, 06:27 AM Hi friends. Im trying to make a perfect selection this image. The image was shoot with chroma background (blue). I need remove background (blue) but I can not remove blue highlights in hair. I have primatte chromakey (digital anarchy) but dont remove spill (blue) in hair. Anyone know a good method?
Thks I would convert to LAB mode and have a look at the A and B channels.
Duplicate the layer and run levels on one (or both) of the channels marking a black point on the background and a white point on the hair.
You should be able to make a pretty good mask combining these two channels.
Rô Hi
This is how I would approach this: http://byloc.com/hair-extract.jpg
1. Original Image
2. Mask made using calculations. (Multiplied the inverse of an enhanced red channel into an enhanced blue channel.)
3. Result of applying that new alpha channel to the hair, we can clearly see the blue highlights.
4. Mask made with calculations by substracting the blue channnel with the red.
5. Result after using that second alpha channnel to mask a level (or curves) ajustment layer that subdued the blue cast.
Note that you can get much much bettter result if the file has better resolution and less jpeg artifact that the one that was posted. Hope this helps, good luck! superfrasky 01-17-2006, 11:39 AM Hi
This is how I would approach this: http://byloc.com/hair-extract.jpg
1. Original Image
2. Mask made using calculations. (Multiplied the inverse of an enhanced red channel into an enhanced blue channel.)
3. Result of applying that new alpha channel to the hair, we can clearly see the blue highlights.
4. Mask made with calculations by substracting the blue channnel with the red.
5. Result after using that second alpha channnel to mask a level (or curves) ajustment layer that subdued the blue cast.
Note that you can get much much bettter result if the file has better resolution and less jpeg artifact that the one that was posted. Hope this helps, good luck!
Great work meok, but I dont understand step 2 and step 4, anyone can explain it more in detail? superfrasky 01-17-2006, 01:37 PM I need help.... I can not remove blue background and blue hair highlights....HELP, HELP,HELP
:cold: Cameraken 01-17-2006, 02:04 PM Hi Superfrasky.
Meok provided a great method which works fine on this picture. However there is perhaps a more useful method here which works on most images.
http://www.russellbrown.com/tips_tech.html
And Larry provided a great explanation here
http://www.retouchpro.com/forums/showthread.php?t=11544
Larry painted out the colour Before the extraction but it can be done after with a layer set to colour and applying the same mask. It can look more natural if you add some colour from the new background.
Hope this helps.
Ken superfrasky 01-17-2006, 03:10 PM thks cameraken, but meok method I think that is good for this image. the problem is that I dont know how make him (2 and 3 step of method) Cameraken 01-17-2006, 03:39 PM Hi Superfrasky.
I think Meok must have a few extra steps. I don’t really understand calculations.
OK. I’ll try and learn with you.
Dupe the Red Channel
Dupe the Blue Channel
On the Red Copy Channel adjust levels
0 1.00 172
On the Blue Copy Channel adjust levels
0 1.00 213
Select Image > Calculations
Source 1
Channel Blue Copy
Source 2
Channel Red Copy Invert Checked
Blending Multiply
Click OK
This makes a new Channel, Alpha1
Image > Adjust > Invert
Adjust Levels
30 1.00 192
This gives something very similar to Meoks Second Picture.
Ken aztek1020 01-17-2006, 04:12 PM are you using photoshop or paintshop pro? Swampy 01-17-2006, 04:57 PM This was a challenge, but here's what I came up with.
Basically did a H/S to put some more color in the hair first.
Used the red and green channels combined (see the great calculation tutorial above, Thanks, Ken!) to generate a mask
Inverted the mask and deleted the blue background.
Used Photoshop's Color Replacement tool (Under the Heal brush) to replace any remaining blue spill. You can go back into Curves and soften the whole thing to more closely restore the ash blond (original) colors.
This looks best on a dark background. I read through meok's method and it's pretty much the same as I did here using the LAB channels.
1) Duplicate the layer;
2) Run levels on the A and B channels marking the background as one extreme (black / white) and the hair as the other;
3) Use Image>Calculations to form a new channel by multiplying the modified A and B channels (have to invert one of them);
4) Make a new duplicate of the original image and apply this channel as a mask;
5) Run Levels on the mask until you get the best possible masking of the edge hairs (don't worry about the inner hairs);
6) Paint the mask to show all the hairs away from the edge;
7) The hairs are now separated from the background, problem now is the colours - take a paintbrush set to blending "Colour" and sample from the "good" hair and paint on the "blue" hair. Vary the sample to get a few differente hues;
8) Put in your new background.
Rô Cameraken 01-17-2006, 06:41 PM (see the great calculation tutorial above, Thanks, Ken!)
Ha Ha. Swampy. That wasn’t a tutorial. That was a complete Guess based on Meok’s method. I have read loads of things about calculations and still don’t understand it.
I understand how to use it. But I don’t understand which channels I should be using or Why and I don’t understand which blending mode to Choose. I guess it will come with practice.
Rô. Your picture looks great.
Using Russell Browns method (as I did in my first post here) some of the stray hairs look very ‘fat/thick’.
I will try your method.
I still think Leuallen’s method of changing the colour of the stray hairs to the colour of the new background Before making the selection makes a lot of sense.
Ken bart_hickman 01-17-2006, 10:52 PM For step 2, he multiplied the inverse of the red channel and the non-inverse of the blue channel. Both the red channel and blue channel were enhanced prior to multiplication. You could enhance them as needed (curve, channel mixer, etc..) to get good contrast. This can be done interactively using adjustment layers rather than layer arithmetic.
For step 4, he subtracted some percentage from the blue channel and replaced that with an equivalent percentage from the red channel. This works because the hair has roughly equal red and blue channels. Again, I found that the channel mixer was more interactive for this step--go to the blue channel, set blue to 20% and red to 80%.
Very educational.
Bart mistermonday 01-17-2006, 11:24 PM I simply converted the orig image to LAB and selected the B channel (most contrast) and duplicated it. Then using the Apply Image command, applied the B channel to itself in Overlay Mode. A simple levels adjust to boost the contrast and the mask was pretty well done. Like Ro, I painted away the blue in the edge hair. Regards, Murray Kraellin 01-18-2006, 12:27 AM if i understand what you want, you want to remove the blue background, but save the blue highlights in the hair? is this right? that's how i read it, so i did this:
craig Flora 01-18-2006, 12:41 AM Hi,
great tips and results!!!! :bigthmb: :bigthmb:
The problem in these extractions (plain flat colour background), for me, is not so much masking and extracting .... (here, because of the 'flyaway hair', I followed Russel Brown's excellent 'Advanced Masking' technique (http://av.adobe.com/russellbrown/AdvancedMasking.mov) and I had a very acceptable mask in no time at all using duplicates of Green and Red Channels in RGB Mode.... ) .... but minimizing/removing the 'leftover colour cast' from the previous background around the edges of my selection.
As usual, there are many ways for doing this, but sometimes it can lead to a nearly complete desaturation, or a rather flat and 'monochrome' colorization ... and, in both cases, the natural difference in colour shades and highlights gets lost .....
I've been 'experimenting' :wink: with this and found that a combination of Hue&Saturation and Selective Colors Adjustment Layers helps a lot... Flora 01-18-2006, 12:52 AM Craig,
it seems you posted while I was still writing my answer ....
you want to remove the blue background, but save the blue highlights in the hair? ... actually, what superfrasky wishes is to get rid of the blue highlights in the hair after changing the background .... :happy:
P.S. I work with Photoshop. Flora 01-18-2006, 09:01 AM I've just tried something different with this picture ...
No masking whatsoever (at least not in the conventional way)
I'm out of the house now, but if interested I'll explain later ... Kraellin 01-18-2006, 11:18 AM flora,
i looked super's posts over again and i think you're right. when he said 'i cannot'' it could have meant 'i cannot because of a restriction from the boss or client' or 'i cannot because i dont know how to do this'. so, i wasnt sure. but, i believe you're correct.
and, you shld know by now that we ALWAYS want to know how you do things! as i've said before, you set the mark that we almost all aspire to, and certainly at least that i do. :) i even bought elements 4 to see if i couldnt approximate your examples a bit better and learn what all those words like 'transform' really are. so, yes, we want to know :)
craig Gary Richardson 01-18-2006, 04:02 PM No masking. I'm intrigued Flora, do explain. bart_hickman 01-19-2006, 12:06 AM The best way I've found for dealing with color cast like this is to use a channel mixer (set to monochrome) to create a mask that selects the area of color--turn up the blue and turn down the green and red). This makes an image (alpha-channel-to-be) that is black everywhere except where the blue is. The stronger the blue, the brighter it is.
Take this image and paste it into ANOTHER channel mixer (effectively masking its effects and constraining it to the blue fringe area.). The levels on this second channel mixer will turn down blue and slightly green, leave red the same.
This effectively replaces meok's step 4 while maintaining the interactivity of a channel adjust layer and avoiding hand-brushing.
I attached the last three steps--1. blue fringe, 2. masked channel mixer layer, 3. blue removed with masked channel mixer. Hair colors are unaffected.
Photoshop--oh yes, and just like everybody else, I'm dying to see what Flora did too. :grin:
Bart superfrasky 01-19-2006, 06:55 AM Thanks all by suggestions, very useful....really THANKS!! :pleased: mistermonday 01-19-2006, 02:42 PM I also found a way to get there without a mask.
1. Convert the image to LAB
2. Add ablank layer on top
3. Fill the blank layer with solid black
4. Double - click that black layer to bring up the Layer Styles control panel
5. Go to the Blend If pull down box and select the B channel
6. Drag the highlight triangle (white) on the bottom layer from the far right to the center. When you get to the center Alt + Click the triangle to split it and the slowly drag the left half of it to the left (toward blue) until all of the whispy hair gets captured but the blue background is still supressed. Click OK
7. Flatten the image (you are still in LAB color).
8 Ctrl M to bring up the Curves control panel. Lock down the Yellow portion of the slope with at least 3 pts from the centre to the top so that the top half will not move when you do what comes next.
9. Take the lower half of the curve and flatten it completely so that it is lying flat on the X axis.
The results seem to be more fine and more accurate in capturing all the whispy hair than any of the other methods I have tried.
Regards, Murray Murray, that's a very neat method. :thumbsup:
Just throwing in another quickie here, using the fact that this is a ChromaKey background......
- Click the eye-dropper on the background;
- Make a new solid colour layer (will be in the background colour);
- Set mode to difference;
- Inspect the result to find a good combination of channels for a mask (Red is good here)
etc.....
Rô mistermonday 01-19-2006, 07:47 PM Ro, thanks. Afterward I found that by pulling the right half of the split triangle back toward the yellow side I was able to define catch effectively all of the whispy edge hairs as they are in the original. BTW, your last technique is neat as well.
Best Regards, Murray Flora 01-19-2006, 11:00 PM Hi everybody,
superfrasky,
you are welcome! ... Glad we could be of help ... :pleased:
Murray,
great technique! :thumbsup: .... I had actually written a Tutorial on a very similar selection method: Using "Blend If" for Selections and Selective Corrections. (http://retouchpro.com/tutorials/?m=show&id=139) ... but never thought of adding a solid black Layer on top ... I have to try it.
Rô,
simple, fast ... great!!! Thank you!!
____________________________________
.... and here is my 'maskless' selection:
In spite of curls and flyaway hair, this picture is quite 'easy' to mask because of its clean contrast between subject and the strong flat colour background ...
After going through one of the conventional routines for masking, as I had done in my first post on this Thread, I simply tried to act directly on the 'colour side' of it ... meaning, I tweaked the background and 'halo' colours directly....
* I opened a Hue/Saturation Adjustment Layer and moved the 'Master' Saturation slider to 100% just to check what colours were where....and realized that background and 'halo' were made by Blues and Cyans ... (Attachment 1).
* ... so ... still working on my Hue/Saturation Adjustment Layer, I moved the 'Master' Saturation slider back to 0, went to the Blues and Cyans and tweaked them as in Attachments 2 and 3
* Attachment 4 shows the result I got with just a simple Hue/Saturation Adjustment Layer .... all curls and even the finest flyaway hairs are intact but cleaned from the bluish 'halo'.
After trying this on this particular picture, I've tried it on other similar images ... needless to say, it works best when the colour contrast is as strong as here or nearly so. Flora 01-20-2006, 02:03 AM .... some more examples of Hue/Saturation background change .... mistermonday 01-20-2006, 06:59 AM Flora, Brilliant!
It is amazing how we often first approach tasks with a complex solution in mind when in fact there is a more elegant solution based on a fundamental concept that gets lost in all of the possible complexities. Thanks you for the additional enlightenment.
Best Regards,
Murray Gary Richardson 01-20-2006, 08:05 AM Gotta agree with Murray, thanks for the breakdown Flora, an education as always. Ken45140 01-20-2006, 02:06 PM Bart: may I ask for a little more help with the method you posted above? You listed the last 3 steps but I must need help with all the rest because I do not wind up with what you show, no matter what variations I have tried.
From your attachments, I seem to get the ColorMixer layer but I can not get the mask layer (that is below the CM layer) to look like yours. I could list my steps but am sure they are wrong or in the wrong order. :confused:
Can you elaborate or ask me what I should post to let you help me?
Thanks,
Ken bart_hickman 01-21-2006, 04:48 PM Hi Ken,
No problem, but I think I'm going to give you the full technique I use for transplanting fuzzy and/or semi-transparent objects from one arbitrary background to another (as opposed to moving between two similar backgrounds or plain color backgrounds which has been explained very well already.)
It's sort of a tutorial I've been working on here and there for about a week, but now I think I'll finish it up using the nice hair example from this thread. I'll post a link to it sometime later this weekend.
Bart Ken45140 01-21-2006, 06:20 PM Bart: that is super. :thumbsup: I am eagerly awaiting and I'll bet others would like to know it also.
Thanks,
Ken bart_hickman 01-21-2006, 06:29 PM Okay, here it is:
http://home.comcast.net/~zumbari/Tutorials/barts_defringe-refringe_object_extraction_tutorial.htm
I've only tested it on a couple situations including the one in this thread. However, the math implies it should work in a huge variety of situations. It should even work with translucent objects (such as bug wings or bridal viels), but I haven't taken the time to test it on things like that. When I do, I'll add that to the tutorial.
Bart Ken45140 01-22-2006, 09:58 AM Bart:
Great work, and a very nice technique.
The good news is that I successfully removed the fringe. :ditsy:
The bad news is that I probably cannot recreate my steps, AND, I also can not for some reason put the black background behind the defringed image. :sad:
I believe this is so because I am still getting familiar with PSPx layers, groups, and masks, and while I got the end result (no defringing), I am very unsure what layers did what and in what order they should be to match what you are doing. I wonder what Photoshop users will come up with if they try to execute your tut within Photoshop. I actually plan to try this within Photoshop just "to see" what happens.
I am not sure how to ask for additional help, and will just keep trying various combinations of layer and group formation. More work on your part (for less gain) is to expand your tut to more clearly describe the (intermediate) steps. Your layer stack picture is also incomplete (cutoff in your capture) and, if the capture were expanded, might offer additional clues on what I need to have in mine.
This is clearly an "advanced technique", and beginners like myself probably have no right mucking around trying to make it work right now.
The attachment (my first) shows the end result and my layer stack (with a black background) but the hair is on a transparent bg, not a black bg. Also, I have a small spot of remaining blue in the lower center of the hair resulting (I think) from careless manual painting on the manual fix layer. As further demonstration of my need for additional learning, I am failing in trying to adjust the remaining blue out.
[Edit: I should mention that I started with a screen capture of the left side of your Figure 1 and did not do the Brown tutorial from scratch. Maybe that fact is contributing to my troubles here. (?)]
Thanks for sharing; super work!
Ken
Photoshop: Anyone else trying this out??? bart_hickman 01-22-2006, 11:29 AM Hi Ken,
The reason you're not seeing the black background is the fringy object isn't contructed correctly. You have a raster layer called "Raster 3" where there should be a mask layer to remove the background (I called this Mask 1 in my tut).
That's a good idea to show the entire layer stackup. I'll put that in at the end of the tut.
Bart ajava 01-22-2006, 04:35 PM I simply converted the orig image to LAB and selected the B channel (most contrast) and duplicated it. Then using the Apply Image command, applied the B channel to itself in Overlay Mode. A simple levels adjust to boost the contrast and the mask was pretty well done. Like Ro, I painted away the blue in the edge hair. Regards, Murray
I get the concept of what's going on here...trying to create as much contrast as possible to allow for distinct black and white areas in the image, to then allow for easy masking. But once you have the great contrasting image, how do you actually make it a mask? I understand masks and how they work, I just really get tripped up when actually trying to create one from a selection. Bear with me here, I'm a newbie! Thanks!!! lkroll 01-22-2006, 05:26 PM Used GIMP. Duplicate the layer many 4 or 5 times since you'll need them. I used the color picker and picked the blue color and created a fill layer. I set the resulting fill layer to Divide and set opacity to 50%. Merge down. Set the resulting layer to Dodge. Paint the obvious parts that suppose to be head/hair white. Desaturate this layer and do an autolevel. Do any necessary obvious b/w fills and cut the layer. Create a layer mask on one of the duplicate base layers and anchor the cut layer in place. Create a transparent layer on top and set to color. Use color picker to pick a good color from the hair and paint the edges (gets rid of the remaining blue). Merge Down. This step removes the mask and also creates the target so that you can copy a new background to it. Delete any remaining base layers. Takes a few minutes to understand this, but, in the end, you can do a mask for this in a matter of a couple of minutes. It heavily depended on the fact that you had a solid color background by the way. Here's the PSD file (http://d58.yousendit.com/D/0WG68KPZFEIJB3JEICLNDYUX8D/hair.psd) (transparency intact; used yousendit to host since the file is over 1Meg and I'm running out of storage space; would have saved it as PNG, but, for some reason transparency of PNG files saved with GIMP is not compatible with PS; a problem that will have to wait til later to figure out). :) Kraellin 01-25-2006, 01:17 PM complex selections like this have always been a bit of a problem for me. i can normally get things fairly decent, but not exact. and i have gotten better, but i still need work.
i'm fairly happy with this technique, but it has limitations because i had to use some blending modes that may not always work on every image. they just happened to work with this one because of the contrasts and brightnesses.
i'm also not going to try to post the steps here as it got pretty convoluted and i'm not even quite sure all i did either. suffice it to say that i'm still trying to perfect a good working technique for all this. i did take some steps no one else has mentioned, though, and i'll give you what i can of those.
i can make a decent mask. that was fairly easy, so i'll skip that. the hard part of this image is that there is blue where you want transparent and there is blue where you dont want transparent. this makes things a bit tricky because if you simply erase the blue you also erase the blue where you dont want to. and if you alter the blue where you do want it to match up with the rest of the hair, you also alter the blue where you want it transparent and removed.
so, one of my steps was to use the 'color replacement' tool in Paint Shop Pro 10. i replaced the blue with black where i wanted it transparent and then used a plugin to 'eliminate black'. that wiped out the blue where i wanted it transparent.
the other odd part i did was not to use a hue/sat layer, but instead used the 'colorize' tool. this allowed me to easily adjust hues from blues to reds while keeping the relative values of the blues over into the reds. it also allowed me to adjust the lightness of the current blues a bit also. this worked REALLY well on this particular image and was one of the last steps i did in getting the full hair-as-i-wanted-it image with the rest of the image as a transparency.
but all of the above needs a bit of work. it's a long process, somewhat inexact and i had to make one final step to bring in the rest of the fringe hair i had lost. i made a new, blank raster layer, put a gradient fill below it and then brought in the original image complete and unchanged and put that below the filled raster layer. i then set the fill layer to 'light' and that brought out the remaining lost fringe from the original.
like i say...i'm still evolving this process :)
craig Ken45140 01-25-2006, 01:45 PM Craig: I am certainly a beginner on these more complex hair extractions. However, as the attachment shows, the BackGround Eraser in PSPx (which you say you use primarily) is more powerful than I had first realized. The following link is an indepth article by the developer of the BGE in which the details are explained. With that and some other help on the PSPx Corel Newsgroup, I was able to produce the extractions illustrated in the figure.
This is the source of the article:
http://tinyurl.com/8h2ck
BTW, the panel talking about the Brown Technique relates to somewhat modified steps to accomplish the same objective in PSPx rather than in Photoshop.
Ken
[Edit: I need to rework the image to lower its size---see next reply.] Ken45140 01-25-2006, 01:48 PM Image to go with previous post.
Ken bart_hickman 01-25-2006, 03:13 PM That BGE is one of those little gems that doesn't get mentioned as much as it should.
Another object extraction method that I use when the background is extremely chaotic and variable, but the foreground object has reasonably sharp edges, is using the vector curve tool to draw a path around the object. You can carefully fine-tune the path, adding nodes or deleting nodes as needed to get a perfect fit. Then convert the path into a selection. This method is called for only in pretty small minority circumstances--the BGE deals with about ~80% of situations. Masking handles most of the rest.
I was going to mention that I often find it beneficial to run the noise removal tool on an image prior to erasing or masking--this smoothes out noise and/or jpeg artifacts that can cause splotchiness in edges.
Bart Ken45140 01-25-2006, 03:23 PM Bart:
Chaos like in this image from another thread? Even the triple screen on the second version, which shows the hair a little more clearly, is still a bear to try and extract. I have tried all sorts of approaches (in PSPx and PS7) and have nothing to show for my 60+ cumulativer minutes working on it. I actually don't think it can be done because of the common color pixels all mixed in with the hair and the wall or vice versa. Esp in the lower right and lower left areas. I notice that no one here has tossed up an "extraction" solution for this one.
Ken bart_hickman 01-25-2006, 09:34 PM That's a pretty pathological situation. I used my previous method--it's at it's limits. I had to apply a curve to the girl depending on the background to make her exposure appear to match. I also did some smudging on Mask 1 and 2 to smooth them out a bit as the original was noisy and artifacty.
Bart Ken45140 01-26-2006, 06:27 AM Bart: You are the master! Do you mind showing me the settings on your Channel Mixer dialog boxes or just write them in text. I'm motivated to give it one more go since I see there is a light at the end of the tunnel. OTOH, maybe I need to practice on another 100 or so before coming back to this one. :evil:
Ken creeduk 01-26-2006, 10:20 AM Talking of Russel Brown, check out his podcasts, he has a new one, extreme masking using multiple methods to really get the mask down! bart_hickman 01-28-2006, 01:03 AM Bart: You are the master! Do you mind showing me the settings on your Channel Mixer dialog boxes or just write them in text.
Ken
:blush: You're too generous!
This extraction has to be done in sections because the background/foreground relationship isn't uniform. The image is also noisy so it's a good idea to do some NR prior to starting. I did three major sections (left, top, right), plus a little bit of cleanup between sections.
Starting with the top first, do the following steps:
-A quadruple screening of the image to brighten up the hair relative to the background wall--you basically did this already.
-Make a small selection (~5x5 pixels) on her forehead--doesn't matter where. (This initial selection is due to a peculiarity in the select color range tool--it needs a seed selection to begin. I've already complained to Corel about it.)
-Make sure the screened image is the active layer and zoom in to about 200-300%. Selections->modify->select color range. Now move your eyedropper (1x1 pixel sampling) carefully over the center of a bright strand of hair and sample it. This becomes the comparison color and the select-color-range tool will select colors similar to this sample. Adjust the tolerance and softness to reasonably capture the hair strands you want while only getting a small amount of background. The 1st attachment shows how the preview window could look after tweaking. Don't copy my numbers exactly--they'll vary a bit depending on exactly where you sampled. Since you can see the selection in real time, simply adjust it to look good--I err towards capturing some background in order to get more foreground. This is because the defringing steps will remove the excess background anyway. Click okay. You should now see the "walking-ants" selection marquee.
-Right mouse click over the active layer and choose "new adjustment layer->curves". This pops up a curve tool. Make a curve roughly like I show in the 2nd attachment. This boosts the brightness on our selection from the previous step as you can see in the before/after panes. Click okay. You'll notice in the layer palette that the curve adjust layer you created has the alpha channel from your selection applied to it (see 3rd attachment.) The brightness boost applies more strongly to the brighter parts of the alpha channel as you see in the 2nd attachment.
-Invert the selection.
-Create another curve adjustment layer--this one will have the inverse alpha channel of the first one. Make a curve like the one in the 4th attachment. This darkens the background. Play with the curve a bit to see what it's doing--sometimes a linear curve isn't the best choice--I just used it here for simplicity. For a linear curve like this, you could have used the levels adjustment layer. (I'm an engineer by profession, so the curve is much more intuitive to me :square:.) Click okay.
What we have done is create a mask for roughly the top third of her hair. The sides need a separate procedure including some hand-brushing the create some hair on the left side because there's no usable contrast. Notice I didn't use the channel mixer--that's because the foreground/background was already well-distinguished by luminance. This will not be the case for the sides. I'll do the sides in coming posts as well as how to combine the three sections.
Bart bart_hickman 01-28-2006, 01:39 AM Now for the right side. It has less distinction in luminance, so we need to mix channels to help this. In this region, the background is strong in R & G and weak in B. The foreground (hair strands) is slightly strong in R, very strong in G, and medium in B. So compare the relative strengths and weaknesses between the two.
Rf < Rb
Gf > Gb
Bf > Bb
On top of that, the foreground luminance is greater than the background luminance.
To translate all of this into only luminance, we accentuate these differences. So I pop open a channel mixer. Red will get turned down (darkens the background more than foreground), Green and blue get turned up (brightens the foreground more than background.) I could write a formula for exactly what the sliders should be, but it's easier to just start with the general directions and go by sight after that. The 1st (and only) attachment shows how the channel mixer looks and how the hair strands have been somewhat accentuated. Let's leave this for now and do the left side of the head (next post).
Bart bart_hickman 01-28-2006, 02:26 AM (Addendum: the attachments didn't come out in the correct order for some reason.)
Now for the left side. What a mess. There's no difference in luminance here at all and a tiny difference in hue and saturation. Looking at the RGB as we did for the right side, the hair strands are strong in red and weak in blue compared to the background. So pop up a channel mixer and crank red up and blue down to make the most of this distinction. I adjusted green to get things centered up. The 1st attachment shows how the channel mixer preview looks. I managed to bring out some contrast, so now do a curve layer (shown in the 2nd attachment.) I'm done--it's clear at this point that the noise is larger than the hair strands so I'm going to have to finish this one up with a hair brush. We'll do that along with the rest of the clean up after everything is combined.
To combine, we simply pick the best from each of the three sections and black out the alpha channel of the adjustment layers that weren't the best. The 3rd attachment shows my layer palette so far. In the group called "Mask 1, top, left, right" are all of my adjustment layers thus far. There are a couple of extras I didn't talk about--but you've seen at least one example of every trick thus far and I'm trying to keep this thing minimized.
You also see in the 3rd attachment a layer group called "Mask 1, combine". This has the three merged results from the three previous sections. I'll simply flip around through the three sections and keep the best parts from each one by selectively erasing. In some cases I even end up with some mixing between sections.
After some soft erasing from each of the sections, "Mask 1, combine", looks like the 4th attachment. The top and right look good--I'll just need some burning to fix those. The right side merely provides guidance on how to use a brush to re-create the hair strands over there. We're not done, but I think you can see the total mask emerging. Now I'll merge this and start the final phase of the Mask 1...next post (I'll try to finish up tomorrow.)
Incidentally, this all seems cumbersome, but it's really not--if I weren't explaining it, I wouldn't be saving all of these steps and I'd only be about 15 minutes into it at this point.
Bart Ken45140 01-28-2006, 12:10 PM Bart: Amazing!! :bow: I am just done with part 1 and am needing to take a break. This is teaching me so much.
You don't spell it out (because you are so used to it) but creating layer groups ahead of time seems essential to turning the group layer into a mask. This is true isn't it? The create mask choice is greyed out when selecting the curves adj layer. Second, I found I had to do some painting on the mask itself as I never got a "clean" one even after color choicing and curves adj. Practice should make this better. But I finally see the approach.
I'll report back after parts 2 and 3 and after more iterations on the technique.
Many thanks.
Ken bart_hickman 01-28-2006, 12:57 PM I do have the image and the subsequent adjustment layers all together in a group--yes. Paint Shop Pro creates a group automatically when you create a mask because that's nearly always what you want to do anyway.
It's not essential that you create the group ahead of time--you could do the work first and then dump everything into a group later as well. Even when I don't *need* a group, I use them to organize things. When you get to part 3, I posted a picture of the layer palette to that point to show the groupings.
Bart bart_hickman 02-01-2006, 12:20 AM When we left off, I had combined the best of several mixing/curving exercizes to arrive at the beginnings of a mask. I looked at it tonight and realized I don't like the far right side, so I did minute of fiddling around using some layer differencing to get the slightly revised fig 1 below. I'm not going to delve into those particular details because it's just more variations on what you've seen already (ie., mixing/curving/adjustment layer masking).
1. Do a copy merge of the "Mask 1, combine" and paste it into a new raster layer.
2. Create a new raster layer on top of that and start painting white in the face area and black in the background area away from hair strands.
3. Copy-merge/paste to new layer that and did some dodging and burning in between hairs to finish it off. This gives fig 2.
4. Looking at the left side, we see our very grainy and dim extraction of the nearly-invisible hair strands. I just caved in and used the fine hair brush and painted some strokes of somewhat transparent white and then finished up with light smudging to smooth it out a bit. I don't feel too guilty about this part because the hair really is nearly invisible. The only reason we can see anything resembling hair is psychological in nature--we see more than what is actually there. Fig 3 shows how it looks after I brushed in some new hair.
5. So that's it--we've created what I call Mask 1. It's time to apply it to our original image. I like to put the Mask 1 extraction on the worst possible new background. Since the old background was sort of black, I choose the exact opposite--something very bright. I just created a new raster layer (it's called raster 1 in the attached layer depiction) with the new color.
6. Now put Mask 1 into a mask layer. Select the original image and create a mask (show all) on it. Then go back to the Mask 1 group (see layer palette attachment), select all, copy, and then go back to the Mask you just created and do "paste into selection" which transfers Mask 1 into the actual mask layer. (This, BTW, is how you can paste the luminance from any selection into a mask or adjustment layer.)
This is what I did in fig 4.
It looks a bit...well...off. Part of the problem is the original is VERY dark and it tends to look unnatural in front of such a bright background. The other part is the fringe effect folks complain about--but in this case the fringe is dark--ie., the old background color still remains mixed into the hair color near the edges of the mask. In this case, the old background color is nearly black. In part 5, we'll get rid of it...mostly. As I originally said, this image is at the limits of what is possible.
Fig 5 (layer palette) shows the new layers we created in this part.
Bart Ken45140 02-01-2006, 06:29 AM Bart: I say it again, this is great work. I have it all captured in an Excel spreadsheet and am working to practice with it. I have numerous real-world images of my grandson which demand its use (including one just like this example, if you can believe it, with dark background right behind the hair area---if nothing else, by learning and applying this technique, you learn to more carefully compose your photos in order to avoid having to apply this technique :shocked: ).
I am not sure how many Paint Shop Pro users read messages here, but you've given them a gem of a tool/approach. Photoshop users have probably been passing right by, although it seems like most of the principles you describe are applicable across platforms, even if the specific steps and layers, etc are not.
I appreciate your sharing.
Ken bart_hickman 02-02-2006, 01:40 AM Time to de-fringe and re-fringe.
1. Defringing. For most backgrounds, I would remove the fringing at this point by burning or multiplying the fringe areas by the inverse of the background. The inverse of the background in this case is nearly white--ie., when the background is black, you don't have to remove the fringe--it's already gone because black is 0,0,0. That is the one and only thing about this extraction that's "easy" (although the step we saved is a trivial one.)
Fig 1 shows the latest way I've been doing this. The de-fringing mask is simply the inverse of Mask 1--saves a lot of trouble. The de-fringing group is wedged in between the original and Mask 1. I usually use burn blend mode for defringing. However, it's sometimes worthwhile to try multiply as well. Kind of depends on how aggressive you were with masking. For this technique, you want to be slightly non-aggressive in your masking--ie., preserve details at the expense of having more fringing. I think you'll get the hang of it with practice (I'm slowly getting the hang of it myself.) It's nice having this flexibility--you can choose between multiply and burn, and you can adjust the opacity slider as well (although I usually have this one at 100%).
Note that "synth old background" layer--that's the original image that's been cloned to recreate the background in the fringe area. This is how the background generally has to be created in situations where the background has different colors. If it is a plain color, then you can just flood fill with that color. Of course if it's a plain color and there's decent contrast, you shouldn't be using this method--you should be using the background eraser.
As I mentioned, this defringing has negligable effect because I'm essentially burning the fringe with white--which of course is a no-op. I only include it for completeness.
2. RE-fringing. Now we add back in the correct fringing for this background (pale yellow). Fig 2 show the re-fringing group--good news again. Mask 2 is repeated here--it's simply the inverse of Mask 1. Mask 2 is applied to another copy of the new background and the blend mode of the resultant group is set to "screen". Screen (and dodge) tends to mix a new color in (whereas burn and multiply tend to de-mix colors). I haven't found dodge to be appropriate yet, but you never know. I usually slide the opacity slider around until the refringing looks about right. The nice thing about this method is once you've set these sliders for the most difficult background, it's about the correct answer for any other background you will try.
3. Fig 3 shows how the extraction looks now. The blotchy messiness is mostly gone now, but the fringing still looks sort of dark. That's because the foreground object is dark. You could screen some more background onto it, but the real solution is to boost the effective EV of the foreground object. Fig 2 shows where to add the boosting curve. By putting it here, it boosts everything associated with the extracted object and has no impact on the new background. Consequently you can vary the amount of boost quite a lot and it still looks natural. Fig 4 shows how it looks after EV boosting.
4. If you want further cleanness (ie., web-publishing), you can turn up the opacity of the re-fringe group and/or use a low opacity, very soft white brush and paint around the edges of the hair on Mask 2 in the re-fringing group--this lets more of the new background show through the hair. What's nice here is if you screw up, you can just go grab another copy of Mask 1 and invert it to start over again.
If you will eventually be using a "realistic" background anyway, that sort of cleanup might not be needed. On top of that most images with any decent amount of contrast will come out looking almost perfect at this point. But even this image looks pretty good on real backgrounds (Fig 5 shows some examples).
Link to fig 5:
http://home.comcast.net/~zumbari/fig5_part5_examples.jpg
That's it!
Bart Ken45140 04-03-2006, 02:17 PM I am resurrecting this thread because I need some basic help on PS7 masks and layers... (no question is too dumb here, only the unasked ones---right?).
I have been trying to increase my PS7 skills in terms of extractions and selections and have been trying to eliminate "fringing". Bart Hickman, who has contributed a lot to my learning in PSP10, worked up an example of fringe removal, and he put it here (http://tinyurl.com/brwt8). He did this in terms of PSP layer stack/palette, and I pretty much understand it that way. In trying to accomplish a similar (same?) result using PS7 and its layer pallete, I am frustrated and cannot.
The Paint Shop Pro layer system works pretty intutively and masked layers can be used with ones above to create composite or blended results. The key is that the mask is on its own layer.
What is throwing me off is that the PS7 layer system puts the mask ON THE SAME LAYER, and I do not know how to set it up to work equivalently as the Paint Shop Pro layer/mask combination.
Here is a word example to go with the figures below (or in Barts tutorial shown above).
I mask out the hair and put it in front of a black background; the hair "whispy" areas have a blue fringe.
I apply a channel mixer mask and adjust so that all that is showing is the fringed hair. I want this to be a mask.
I sample the color of the fringed color and fill a layer with this color and invert it.
I want to multiply blend this inverted color LAYER, masked by the channel mixed fringe area with the original fringed image LAYER, which will then eliminate the blue fringe.
I cannot do it. I have studied (and tried) clipping groups and layer sets (remember, PS7 and not PSCS), and can not find the combination of mask, layer, group, set, or ??? to accomplish the removal of the blue fringe from the hair.
This is complicated to explain and I don't blame anyone for passing by, but if anyone can set me straight, I would be grateful.
Thanks,
Ken Swampy 04-03-2006, 02:47 PM >>>I sample the color of the fringed color and fill a layer with this color and invert it.
>>>>I want to multiply blend this inverted color LAYER, masked by the channel mixed fringe area with the original fringed image LAYER, which will then eliminate the blue fringe.
-------
Try loading the mask of the fringe area (Option click on the Layer's mask). With that selection still active, select the inverted blue filled layer and click on the "apply mask" button at the bottom of the layer's palette.
This should load the same mask selection into the blue layer. I'm glad I came in late on this one. :) Instead of putting in a lot of time trying to get it right, now I can just try the great techniques posted here. Thanks for doing all the hard work! ;)
Ed bart_hickman 04-03-2006, 08:42 PM Hi Ken,
The mask is the biggest difference between Paint Shop Pro and Photoshop. Once you get that figured out, the rest is cake.
The first attachment shows the generic translation from Paint Shop Pro mask to Photoshop mask. To apply a mask to the active layer, Paint Shop Pro creates a mask layer on above the active layer, then puts the two into a group. So while I agree with you the Paint Shop Pro method is more intuitive, it's much less compact.
Figure 4 from that tutorial will then simply look like the second attachment with the "Remove old fringe" set to multiply.
I did this already and discovered it doesn't quite work as well in Photoshop as it does in Paint Shop Pro. There's something different about the way the two programs are doing multiply with masks.
No matter. Photoshop has the linear light blend mode--change the blend mode of the "Remove old fringe" to linear light. Then adjust the opacity up or down to make it look good--50% seems about right. This is kind of nice because it means you have +/-50% of fudge range to work with.
I finished up the method and the layer palette is shown in the 3rd attachment (corresponds to figure 7 in the tutorial.) Still use the screen blend mode for that.
One more important thing: Layer groups default to "pass through" blend mode in Photoshop. Be sure to change it to "normal".
Bart Ken45140 04-03-2006, 09:32 PM Hey Bart: I was hoping you would respond.
Sorry for my denseness, but it seems like a key step is missing.
In figure 4 from your tutorial, you create Mask2 by using a Channel mixer to isolate the blue fringies. Where is that in what you posted above? Your attachment of the Photoshop set shows the Mask on the inverted blue layer as if it just popped out of nowhere. It has to be created from a channel mix adj layer, yes? Its even shown in your Figure 3. I even have it on a Photoshop adj layer but ..... so, I just created a channel mask by using the magic wand on it, inverting it, and saving it as a channel (called Mask2). Now I'm stuck on getting this combined with a filled layer of the browish inverted blue color (your "remove old fringe" layer).
What am I missing??? (or is a step or two missing from your comments?)
Thanks for helping.
Ken
Edit: I reread Swampy's note and tried that and got something directionally correct it seems, but the quality of the Mask2 I created with the magic wand, and saved as a channel which I load back, really sucks....so the resulting image is a combination of some blue some brown and some hair....so, it seems like I still need to understand what you are showing me. bart_hickman 04-04-2006, 01:02 AM In figure 4 from your tutorial, you create Mask2 by using a Channel mixer to isolate the blue fringies. Where is that in what you posted above? Your attachment of the Photoshop set shows the Mask on the inverted blue layer as if it just popped out of nowhere.
In fig 4 I'm not creating Mask 2--I'm using it to remove the fringe. I don't see any channel mixers in that figure.
Mask 2 itself is created up in fig 2 "The making of Mask 2". In Paint Shop Pro, I would have simply raster-copied the "Mask 2 construction" group and pasted it into the "mask 2" mask layer. In Photoshop, I alt-select the mask, then paste which puts the clipboard into the mask.
It has to be created from a channel mix adj layer, yes?
YES! At least that's my preferred method.
Its even shown in your Figure 3.
Figure 3 just shows Mask 2. Figure 2 has the channel mixer. See comment above.
I even have it on a Photoshop adj layer but ..... so, I just created a channel mask by using the magic wand on it, inverting it, and saving it as a channel (called Mask2).
Aaaack! Not the magic wand. :shocked:
To copy a raster image into a mask, do the following (in this case, you actually want to do a copy-merge of a group and paste that into a mask)
1. Alt-click the eyeball for the Mask 2 construction group (you should now see Mask 2)
2. Ctrl-A, then Ctrl-shift-c. (you've now got Mask 2 in the clipboard)
3. Alt-click the eyeball again to return layer visibilities to previous states.
4. Alt-click the mask thumbnail that will become Mask 2.
5. Ctrl-V (puts the clipboard into the Mask).
Here's a cheat sheet for all the basic mask operations in Photoshop (at least the one's I use.)
http://home.comcast.net/~zumbari/Tutorials/Photoshop_CS2_cheet_sheet.pdf
Now I'm stuck on getting this combined with a filled layer of the browish inverted blue color (your "remove old fringe" layer).
What am I missing??? (or is a step or two missing from your comments?)
Woohoohhahaahaaaaa (evil laugh) :devil: There are always steps missing. I prefer to teach using riddles--sort of like Merlin. :dizzy:
I think one of your sticking points is you're trying to combine the creation of Mask 2 into the defringing group and that's not what I was doing (I don't think it's even possible). The group where I create Mask 2 is completely separate from the group that does that actual defringe/refringe operation.
I've attached a layer palette showing *almost* the entire layer stackup. I say "almost" because the "fringy object on black background" also requires a couple of layers to create. I didn't include this for Paint Shop Pro because the layer stackup was way too big. Note how the Mask 1 and Mask 2 construction groups are down at the bottom underneath the new background and thus not contributing directly to the final image. They are simply a scratch-pad area used to calculate the masks. Once I'm done with that, they aren't needed anymore.
Two final notes:
-I don't think you want to use fill layers here. Instead use a raster layer. Just sample the original background color, then fill the raster layer, then invert it. In many cases, you won't have a uniform background color anyway.
-The mask computation is the hard part and I usually iterate two or three times for both Mask 1 and Mask 2.
Bart Ken45140 04-04-2006, 07:23 AM Bart:
Aha, success! :pleased: :pleased:
Many thanks. :bow: :bow: :bow:
Probably, the KEY key (main key) was the cheat sheet. I own at least four Photoshop books, and have on my desk two more CS books from the library, and while I "confess" to not having read any of them cover to cover, I have done a lot of reading. I cannot recall a single mention of Alt-clicking on the eyeball to "see" that layer, nor any of the Ctrl-Clicks or Alt-Clicks on the various mask and image icons. I will go looking for such mentions now and will probably find them many places now. :shocked:
In any case, I have my version of the layer stack and the result--see attachment. Now some more practice.
I guess the Paint Shop Pro approach, while less compact (more layers) has a more intuitive "stack buildup" process. If you are making the original mask from color channel breakout and associated channel contrast setting, the Paint Shop Pro is tons more awkward (due acknowledgment to your color channel separation script). But now that I see the Photoshop approach, and practice with it, it will become the more "handy".
Again, many thanks.
Ken
Photoshop: I hope all you lurkers are taking notes as this seems like a super way of isolating complex subjects from the background. bart_hickman 04-04-2006, 10:38 AM Bart:
Aha, success! :pleased: :pleased:
Many thanks. :bow: :bow: :bow:
Probably, the KEY key (main key) was the cheat sheet. I own at least four Photoshop books, and have on my desk two more CS books from the library, and while I "confess" to not having read any of them cover to cover, I have done a lot of reading. I cannot recall a single mention of Alt-clicking on the eyeball to "see" that layer, nor any of the Ctrl-Clicks or Alt-Clicks on the various mask and image icons. I will go looking for such mentions now and will probably find them many places now. :shocked:
:pleased: Congrats!
I got all of that information from the Photoshop manual. Whenever Adobe describes a function, they describe every way of doing it including all of the funky key combinations.
Just read the chapters on Selecting and Layers and you will know everything you need about this stuff. It's a good read! I highly recommend it!
Another hint: ANYWHERE you use a mouse click, also try out alt-click, ctrl-click, atl-ctrl-click, shift-click, etc... to see if anything interesting happens. Eg., if you hold the alt key while in a filter or adjustment dialog, the "cancel" button changes to the "reset" button.
Bart | |