Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Simple key by subtracting the background

Hi


I will be very grateful for any help. I want to create a simple key similar to that used in Ichat i.e. the background is removed by taking an image/short sequence of the background then subtracting that background from the talent filmed afterwards. Keying with a blue or green screen etc is not a problem. However, a simple/low end key with almost any background is what I am looking to achieve but don't know if this is possible in Shake. I expect that the camera will have to be perfectly still so that the image of the background is exactly the same with and without the talent.


All help appreciated!

Posted on Aug 18, 2011 1:50 PM

Reply
Question marked as Best reply

Posted on Aug 19, 2011 2:50 PM

Hi,


The Backdrop effects in iChat (And Photo Booth) are created with Quartz Files.


If you use the Install Disk > Optional Installs folder > XCode you will get Delevopers Tools.
Quartz Composer is installed as part of this process.


The .qtz files can then be opened in Quartz Composer and you can explore haow they are put together
They are stored in Hard Drive/System/Library/Compositions.


How you might use these in other apps is beyonfd my knowledge.


(I was checking on posts with "iChat" in them)





User uploaded file
10:50 PM Friday; August 19, 2011

Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"


 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb( 10.6.8)
 Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images."  No, Seriously

9 replies
Question marked as Best reply

Aug 19, 2011 2:50 PM in response to MacP1

Hi,


The Backdrop effects in iChat (And Photo Booth) are created with Quartz Files.


If you use the Install Disk > Optional Installs folder > XCode you will get Delevopers Tools.
Quartz Composer is installed as part of this process.


The .qtz files can then be opened in Quartz Composer and you can explore haow they are put together
They are stored in Hard Drive/System/Library/Compositions.


How you might use these in other apps is beyonfd my knowledge.


(I was checking on posts with "iChat" in them)





User uploaded file
10:50 PM Friday; August 19, 2011

Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"


 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb( 10.6.8)
 Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images."  No, Seriously

Aug 20, 2011 1:01 AM in response to MacP1

Hi Ralph,


I appreciate the additional line of enquiry. Something to investigate. Still hoping there might be a solution within Shake itself so that I can take advantage of its compositing tools. I don't need a real time solution. The nearest I can get to is something that incorporates an ISubA node to compare the foreground with the background but then I run out of ideas and it only gets me part way there. Perhaps through this method I can somehow extract a mask from the outline? Anyone?


Thanks

Aug 21, 2011 5:02 AM in response to MacP1

Phyx Keyer, comes with Plate abilities. Using Plates is old hat in film. Much easier in digital video now. Simply shoot the scene without actors. Shoot again with actors. Phyx Keyer will allow you to apply the Plate, which keys out the actors from the background. Very easy, very fast, works in FCP legacy, FCP X, Motion 5, and AE. Was originally a Shake plugin.

Aug 21, 2011 12:15 PM in response to MacP1

Hi BenB


Really appreciate the suggestion. I will give this some serious thought. I have had a look. Doesn't look like there is a trial version and it takes some financial commitment so I will have to think carefully. However, you are right, this seems to perform the task I am looking for save for it no longer being a plug in for Shake which is a shame. Thanks for the lead on this. Still hoping there may be a way in Shake so that I can perform other composites as part of the same script to avoid a two stage process i.e. export out of FCP and then work on it in Shake.


Thanks.

Aug 21, 2011 1:12 PM in response to MacP1

MacP1 wrote:

Still hoping there may be a way in Shake

To create a difference matte in Shake, use an ISubA followed by a LumaKey. Then you can take the output the LumaKey as your matte, and use a KeyMix for the composite.


Difference mattes are notoriously ineffective. Look at your alpha channel in the LumaKey. All the little white spots in the otherwise black background area are places where the camera or background moved, or the result of noise. All the little black spots in the otherwise white foreground area are places where the foreground image pixels just happen to be the same as the background.


You can improve the result somewhat by making LumaKey's hiVal and loVal very close to each other, and by following LumaKey with a DilateErode.


You could probably improve your results by careful lighting, too, especially using enough light to minimize noise.


Then there's always RotoShape. 🙂

Aug 21, 2011 1:49 PM in response to MacP1

Hi Stuckfootage


I'll give that a go. I'm far from expert so it will probably take me a few days of trial and error to piece this together (back to the day job tomorrow). If you have an example of the node tree that would be brilliant. Nonetheless this gives me something to immediately get my teeth into so I am very grateful. Sounds hopeful but definitely looking to avoid RotoShape! 🙂


Will post back when I have worked this through. For now, thanks very much.

Aug 22, 2011 1:38 PM in response to MacP1

MacP1 wrote:

If you have an example of the node tree that would be brilliant.


I've pasted an example script below. For some reason, this forum software adds carriage returns to the RotoShape data, which ruins it. So paste the script into Shake, then create a little triangle in the middle of the RotoShape. That triangle is your actor.


First of all, I've created two fake images (one with a triangle on grey background and one with just the grey backgorund). Then I've added film grain to simulate the real world (you probably have video noise, but the effect is the same). So the outputs of the two film grain nodes represent your original footage. Important note: the two film grain nodes use a different seed value. Otherwise, they would be identical. In the real world noise is different for each frame. This is important.


Just to be clear, you will substitute your two FileIn nodes for the whole Rotoshape/Color/Max/FilmGrain section.


Now for the difference matte. As mentioned in my previous post, you use ISubA to subtract the two images, followed by a LumaKey to actually create a matte. Look at the alpha channel of the LumaKey and try to adjust the loVal and hiVal to get a good key. You'll see how the noise (film grain) is a big problem.


Finally, I use the LumaKey to composite the foreground image against a lovely orange background. You'll see that it does work, but it's not perfect. That's a difference matte example.


Les





Color1 = Color(1280, 720, 1, 0.4, 0.4, 0.4, 1, 0);

Color2 = Color(1280, 720, 1, 1, 0.5, 0, 1, 0);

RotoShape1 = RotoShape(1280, 720, 1, "v4.10", 0, 0, 0, 1, 1,

xScale, width/2, height/2, 0, 0.5, 0, 384, "100W@0B000VDhsuH9RYbMXJCo8QUPcJkW66fOX2cOZe2cwdLnSH198Q8CsQa9SO3XAO6mQgLH1KZ26 15W18QecceNcffdG6a#5bNc#zbl9EAcRHM#vaVpfvqKHf6fbgf26edf2efWcX1v98Qe1seZfd0f6DfqB sHThwmDdkXf2KGDeUpTHGdCSzfbk3xAJQSsbacHsjYGtn6w0dGHSP9PDme2ma5MC0YWR8ZEK98nCZ34V mOYRkm5xB0WY7RW1642q026CmW3EOenBEqmGpTSUGs0W0bM#1IEbIXSpl0lism3i19FIkOvO03s900IG mSY19dB000000000018");

FilmGrain2 = FilmGrain(Color1, "v3.0", 2, 1, 1, 2, "Eastman 5245",

0.031722, 0.020731, 0.047893, 1.14428, 0.993067, 0.997656,

0, 0, 0, 0.091092, 2.671764, 2.903616, 3.183743);

Max1 = Max(RotoShape1, Color1, 1, 100);

FilmGrain1 = FilmGrain(Max1, "v3.0", 2, 1, 1, time, "Eastman 5245",

0.031722, 0.020731, 0.047893, 1.14428, 0.993067, 0.997656,

0, 0, 0, 0.091092, 2.671764, 2.903616, 3.183743);

ISubA1 = ISubA(FilmGrain1, FilmGrain2, 1, 100);

LumaKey1 = LumaKey(ISubA1, 0.2, 0.3, 0, 0, 0);

KeyMix1 = KeyMix(Color2, FilmGrain1, LumaKey1, 1, "A", 100, 0);

Aug 23, 2011 1:34 PM in response to MacP1

Generally to create a Difference Matte in Shake, I use the "Common" node - this can be set to produce black where things are the same and white where they differ. To do any kind of difference matte, you need a clean plate so you can have something to be different from (why in iChat they make you step out of the frame).


Use this Search to find other posts with this technique.

Aug 23, 2011 2:05 PM in response to MacP1

Les


Thank you so much for taking the trouble to supply a sample script. I see the limitations you are referring to re grain. Trying some other images shows that if the background is 'busy' some of that shows through the foreground image after the ISubA. I will continue to experiment but you have certainly helped greatly.


Patrick, thanks very much for this additional lead. I will indeed use the search to investigate how best to use the Common node and report my progress.

Simple key by subtracting the background

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.