Nova Design Logo


Main
Tutorials - Main
IFXCurrents - Main
ifx currents banner

Tutorials for ImageFX for the Amiga



All contents are Copyright - 1999, 2000 by Nova Design, Inc. All rights reserved. These documents may not be reproduced by any means without the express, written, permission of Nova Design, Inc.

Copyright - 1999, 2000 by Nova Design, Inc.

It is often helpful to hear what other users are doing with an application. If you would like to ask other ImageFX users about techniques and uses of ImageFX you can subscribe to Nova Design's ImageFX mailing list by going HERE and following the "Membership/Subscribe" link.

The ImageFX Currents Tutorials have been put into this HTML archive by the following individuals (Listed in alphabetical order):

  • Wil Haslup
  • John Whiting
  • Kermit Woodall

Logo illustration by Kermit Woodall
Edited by John A. Whiting
HTML coded by Wil Haslup and John A. Whiting
Screencaptures by Dave Matthews


ImageFX Tutorial: Part 3
Cinemautofx


By Dave Matthews

One of Hollywood's most used special effects involves placing real actors in computer generated sets. This is accomplished by use of blue or green screen. Simply put, you film the actor against a special blue or green cloth, then use computers to replace the particular blue or green with footage.

Figure 1
Figure 1: Blue Screen Foreground

This is a useful effect not only for mixing live and CG action, but also for adding flexibility and saving time when rendering 3D scenes. For instance, I once did an animation of a Mars lander. Since I was on a tight deadline, instead of rendering the Lander and the Mars landscape for every frame, I rendered the landscape once, then rendered the Lander vehicle against a blue backdrop. Now I could have rendered the Landscape and used it as a background image while rendering, but the blue screen approach gave me move flexibility. For instance, while I was rendering the Lander, I grew dissatisfied with the backdrop image. Once I had the Lander frames rendered, I simply re-rendered the background, correcting the flaw, which took a matter of minutes. Had I had to render the Lander sequence with the backdrop again, it would have taken hours.

Figure 2
Figure 2: Mars Background

In order to accomplish this, a matte is used. A matte tells the software where the background in the image is, and where the foreground is. This is why actors are filmed against the usually horrible blue or green colors, since these colors are hopefully not in the actors clothing or skin tones, it makes it easy for the software to distinguish the background. Once the software determines the background, this color is removed. This is called keying the foreground. The final step is to compose the backdrop image with the keyed foreground. Where ever there was background color, the backdrop image will show through.

Cinematte

ImageFX has a powerful implementation of this effect, called Cinematte. Cinematte offers enough power to satisfy the professional, yet the basic setup is easy enough for humble Amazing Computing authors to use. The basic procedure goes like this: load your backdrop image into a buffer, load your foreground picture (the one with the blue or green background). Make sure your foreground image is in the main buffer, and the backdrop image is in the swap. Load Cinematte via the Hook button. For many applications, the auto detect setting will correctly determine the right color to use. For Output, sometimes I use the Composite only, though sometimes I like to save the matte to the alpha channel as well. Cinematte can even scale the background image to match the foreground.

Figure 3
Figure 3: Matte from CineMatte

Look at Figures 1 through 4. Figure 1 shows the foreground image, as rendered in Aladdin 4D, with the Mars lander against a blue field. Notice that this image is in the Main ImageFX buffer. Figure 2 shows the Martian landscape I rendered separately, in the ImageFX swap buffer.Figure 3 shows the Cinematte produced Matte, and Figure 4 shows the final composite.

Figure 4
Figure 4: Final Composition

Figure 5 is the Cinematte Interface, showing the default values for the Keying section.

Figure 5
Figure 5: CineMatte: Keying Menu

The Menu cycle gadget accesses the main functions of Cinematte, Keying, Matte and Output.

The Keying Section

The First item in the Keying section is "Screen Color". This tells Cinematte what color will be the transparent color, or backing. In Figure 3, this is set to Auto detect, and Cinematte has correctly chosen Blue. Auto Detect samples the image and uses the most frequent color from the RGBCMY (red, green, blue, cyan, magenta, yellow.) You can specify other colors as well, red, green, blue, cyan, magenta, or yellow from the cycle gadget, or use the Detect any color. This mode samples the image for the most frequent 24 bit color and uses non-color specific code to make the matte. For most cases, Auto Detect works better. Or use the set any color option. Select this option, and you can either type the decimal numbers for the Red, Green and Blue values, or click on the little eyedropper to the right, and then click on a color in the top preview window.

The next item is the Output cycle gadget. Here you tell Cinematte what to produce as output. Matte & Keyed Foreground will save the keyed foreground to the main buffer, and also will save the matte to the alpha channel. Composite Only will save only the final Composite image in the main buffer. Matte & Composite saves the composite image to the main buffer, and the matte to the alpha channel. Matte only saves just the matte to the alpha channel, and "Keyed FG only" saves just the keyed foreground to the main buffer.

Display tells Cinematte what to display in the bottom Preview window. You can display the keyed foreground, the Matte, the Composite or the Swap image.

The Dynamic Range checkbox tells Cinematte to expand the matte to use a full range of 256 greys. Normally this should be on. It won't make any difference for simple black and white mattes, but if you use any blur on your matte, or plan to tweak the matte in other ways, you'll want this on.

Noise Filter is used to clean up noisy areas of the blue screen. This isn't a problem for rendered shots, where you have a perfect blue screen, but for live action, the blue or green screen may be slightly wrinkled, dirty or poorly lit, and this option helps compensate for that.

The Correction gadget is used to even out an uneven backing, in conjunction with a clean plate. This works by looking for differences in the color of the backing, and calculates a correction factor to use when creating the matte. For instance, if there was a spot in the backing with a bit of glare, clicking on the eye dropper and pointing at that area would allow Cinematte to correct for that area when creating the matte. Be careful with this option, as too much correction will steal into the actual foreground image, resulting in transparent holes, or even the entire image being transparent.

Clean Plate. This option, also known as screen correction image, allows you to load in a clean plate image. This is a shot of the blue screen without any actors or other foreground objects. A clean plate gives Cinematte a reference to compare with the foreground image, to better pick the correct color.

Clean Plate Error. Set an amount for Cinematte to compensate for differences between the clean plate image and the foreground screen.

The Matte Section

See Figure 6. Here are the options for adjusting the matte. You'll want the Dynamic Range checked for these, and you'll probably want the display set to Matte.

Figure 6
Figure 6: CineMatte: Matte Menu

Force Black is used to force the darker greys in a matte to black. Use this if there are dark areas in the matte that aren't transparent enough. The higher the value, the more greys are turned black.

Force White, the opposite of Force Black. This takes values that are close to white, and bleaches them to white. Useful if there are light areas that are too transparent.

Gamma controls the overall contrast and brightness of the matte, without bothering the mid greys. This can be useful in controlling halos.

Using Matte Blur, you can soften the edges of the actors or objects in front of the blue screen. Bbe frugal with this, not only do high values destroy definition of the foreground objects, this can also slow down the compositing process tremendously. Start with values between 1 and 4, see if those are sufficient.

Matte choking is used to shrink the matte edges, or expand them. Use negative values to shrink the white (opaque) areas of the matte,and positive values to expand them. Generally, you'll use values like -1 to eliminate those ghostly halos from poorly shot blue screens. Positive values could be used to create halos, force fields or like effects around your foreground objects.

The Output Section

See Figure 7. This section has options for affecting the actual files saved by Cinematte.

Figure 7
Figure 7: CineMatte: Output Menu

Protection. This option lets you tweak areas that are semi transparent. You can add in (negative values) or take out the screen's color (i.e. blue) from the foreground color.

Light Color RGB: Here you can replace the screen color with a new color in semi transparent areas. This is normally used to match spill lighting when doing live action against the blue/green screen.

Screen Removal. This option removes screen color from the foreground image. This option greatly affects the results of the protection. For an interesting effect, try setting protection to 256, and screen removal to 0.

Blend is used to determine how much of the foreground objects are mixed into the final composite. At a value of 255, the foreground objects will be fully mixed into the composite, at a value of 0, no foreground objects will be mixed into the composite. Values in between can be used to fade the foreground objects into or out of the composite. For composing my Lander with a Martian landscape, most of the other options could be ignored, or left at default values. These are generally used to deal with real world blue or green cloth, which often requires a bit of extra work to achieve the best results. You may have seen this on low budget films, where the actor seems to have a ghostly halo, or even where parts of the actor seem to be invisible, letting the background show through.

My Travels with Matte

OK, so Cinematte is both easy and powerful. Even so, manually doing this for an animation running in the hundreds of frames would be unbearably tedious and time consuming. Luckily, Cinematte can be used with AutoFX. In AutoFX, select the foreground images you want to use in the main buffer. Select the backdrop image in the swap buffer. Use the follow commands:

Load.ifx
CineMatte.ifx
SaveBufferAs_ILBM.ifx

When you Press the Begin Button, you will be presented with the basic CineMatte requester. This requester has the following options:

Screen Color: (For my Mars lander, AutoDetect works beautifully)
Output: (I used Composite only, but Matte & Composite might be useful)
Dynamic Range: (ON)
Force Black: 0
Force White: 0

Click Okay and the Save Buffer As requester pops up. Select your destination directory and new Extension, and click Okay. Your sequence of images will be composited and saved as ILBMs.

Note: You can access all the functions of Cinematte via Arexx, but that's beyond the scope of this article. Look in ImageFX help files under Arexx Docs/Hooks/Cinematte.

Tips:

The "blue" screen doesn't have to be blue. If your foreground image contains blue, you can use a different color to key. The idea is to pick a color that isn't contained in the foreground image.

If you're shooting live footage against a blue screen, lighting is critical. Try to keep the blue screen evenly and uniformly lit, with no hotspots, or shadowed areas.

While normally you don't want the foreground to contain any of the blue screen or keyed color, you can use this for special effects, like the invisible man, or woman, effect, where the actor wears a body suit of the appropriate color.

Glossary:

Backing: This is the transparent screen area of the foreground image. Generally, this will be green or blue, but other colors can be used.

Matte: Black and White or grey scale image, used for compositing images. White areas are opaque, black areas are transparent, and grey values are in between.

Keying: The process of removing transparent areas from a foreground image, defined by a matte. Cinematte can display and save this keyed foreground image, which sometimes can be helpful in refining the matte.

Alpha Channel: Like a matte, an alpha channel is composed of grey scale values used to determine transparent areas. If the image format supports it, alpha channels are generally saved as part of the image,although normally are not seen when displaying the image. They can also be saved as separate grey scale images.IFF, PNG, Targa and ImageFX's native INGF format are file types that support alpha channels. However, although ImageFX can save Targa w/ Alpha channels, it doesn't seem to find the alpha channel information when loading, even though it asks if you want to load the alpha channel. If you need to export to PC or Mac, Targa w/ alpha channel is a good option. If you need to keep these for further work in ImageFX, save as IFF w/ Alpha or INGF (INGF also supports layers). You may also want to save the Alpha channel as a separate image.

Clean Plate: A clean plate, or screen correction image, is a shot of the backdrop screen, minus any foreground elements. If you are shooting actors against a blue screen, the clean plate would be a shot of the blue screen, with the same lighting, but without the actors. This serves as a standard reference or comparison image.

As always, you can reach me via email at: DaveSMatthews@netscape.net

If you have an idea for an article or tutorial please drop an email to the current editor of these tutorial pages.

***


Links: