Refill Manual

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

RE:Fill Users' Manual

What is RE:Fill ?
RE:Fill ™ is a compositor’s secret spice. In essence it mends small holes in your image,
missing pixel regions often generated by the compositing process. You specify the areas
to be replaced and RE:Fill fills-in pixels in the supplied regions.

RE:Fill is a set of 6 plugins that deals with a variety of technical problems related to
missing or invalid pixel data in your images. A simpler example is a defective pixel in the
camera. This results in a blob in the middle of the image for the whole sequence. This
gets particularly obnoxious if one zooms on such image. To deal with that, you simply
provide by any mean a matte (or empty values in the alpha channel) to indicate to the
filler the area to replace. RE:Fill also includes some alpha completion tools.

This documentation first reviews common concepts to all RE:Fill plugins and then
describes each of the plugins, parameter by parameter. It is complemented by practical
examples of RE:Fill in action on specific problems.

• What is a Hole?
• RE:Fill Area Fill
• RE:Fill Offset
• RE:Fill Frame Borders
• RE:Fill Grow-Shrink Holes
• RE:Fill Choke
• RE:Fill Alpha

Disclaimer: Although many of the examples provided here deal with repairing defects in
imagery, these plugins do not find the offending areas automatically. You will have to tell
the plugins of RE:Fill where the missing data or "holes" are. The hole maps can be made
using other tools including keyers, roto paint and geometric rotomasks. The plugins of
RE:Fill are designed to fill in problem areas once you have defined them.

General Note for different applications:

Non After Effects Users: This documentation uses After Effects screenshots. For
example in Combustion we use a slightly different layout and shorter names for settings
in the plugins.

Premiere Pro Users: Please read about limitations here:


http://revisionfx.com/support/faqs/hostfaqs/premiere_pro/
Final Cut Pro Users: Please note when reading this manual that menus and checkboxes
are not animatable in FCP.

Terminology Used in this Document

Sources and Destination: For the sake of this document we use the word Source to
specify an input image and Destination to discuss the final output result.

We distinguish between an anti-aliased alpha (with greyscale values) and a binary


coverage matte.

Coverage or Binary Image: A two-level image where pixels are either 0 (fully-off) or 1
(fully-on).

Holes: Area to replace. The Hole can have greyscale value which are then interpreted as
absolutely not inside (black), absolutely inside (white) and partially covering. A threshold
value allow the user to tweak in context the part of the greyscale value that we will
consider fully empty pixels.

Holes: Holes: what they are and how to make them?


You supply "hole" images as grayscale maps like a matte. We use the word "hole" to
make a clear distinction from compositing mattes or other uses of grayscale images.
These hole images determine whether a pixel is invalid (that is, should be replaced or
modified) or not. Internally, the RE:Fill plugins convert the grayscale image you supply
into 1 or 2 binary coverage images ("on" or "off") via a threshold value. A replacement
color pixel is created for each pixel where the binary image is "on" . We will often refer
to the replacement pixel as a "filled" pixel, and the process of mending the hole as "hole
filling." The replacement pixels are then blended back into the source image based on the
greyscale hole image you have supplied.

RE:Fill uses common settings to help you construct, display and fill holes in your
imagery as shown:
We will use the simple example below to describe what each of the settings are and how
they are set and used. In the example, we wish to remove the light switch.

A binary coverage hole image is created from a single image channel as specified in the
Source Channel setting (which can be set to Red, Green, Blue or Alpha). It is very
common that the image you are repairing has the hole defined in its alpha channel. In this
case, you can simply before you apply the effect set the Source Channel to Alpha and
leave the ALT Source set to None (when set to None the hole image is retrieved from a
channel in the image being repaired). It is often desirable to construct a hole image and
keep it separate from the image being repaired. Such an image may be constructed via a
separate process such as keying, 2D geometry masking, and roto painting. When you
would like the hole image to come from an image other than the one being repaired, you
can point to the image source containing the holes by setting ALT Source to that image
source (and, of course, setting the Source Channel appropriately).

Although internally the hole image is binary (either on or off), you will often want to
provide a grayscale image to specify the holes. In order to create a hole image from the
grayscale image, you'll use the Threshold setting to create the internal binary coverage.
There is a viewing mode (discussed below) that lets you see exactly which pixels will be
replaced. There is an “invert” checkbox toggle to accommodate working with "black"
holes or "white" holes.

Grayscale values other than zero (off) or full (on) in your hole image allow you to create
smooth edge transitions at the boundary of the holes.
Practical Example: Here we have a picture shot in England (A). The action is supposed
to happen in Mexico. The light switch reveals the shooting location, so we need to
eliminate it from the picture. We make a hole (B) with a geometric Mask. We expand the
mask and feather it (with the host application's tools, not RE:Fill) so we have a nice
smooth edge ramp (C). In this example we will be using image (C) as the hole image
input.

How does RE:Fill use image (C) to fill the hole? From image (C) RE:Fill creates a binary
image of pixels to fill. RE:Fill does this by thresholding using the Threshold value you
supply:

Grayscale image (C) thresholded at three different Threshold values to create the binary
hole (which determines which pixels to repair).

The repaired pixels are then blended back onto the original color image using the
grayscale image that you have provided. However, since the binary hole can change size
(based on the threshold value), RE:Fill needs to modify the original grayscale hole image
so that the blend occurs solely within the binary hole (put another way: RE:Fill can't
blend in pixels where it hasn't created any!). RE:Fill creates the blend (or compositing)
map by zeroing out all areas of the grayscale image that fall outside the binary
(thresholded) hole, and then linearly transforms the pixels inside the binary hole so that
pixels near the binary hole edges are zero. The following picture demonstrates this:

This picture shows the compositing or "blend" map created from image (C) to blend filled
pixels with the original color image. The blend map is shown for the same threshold values
that were used in the previous figure. Note that in each case no blending will occur outside
of the binary hole created, as shown in the previous figure.

RULE OF THUMB: Always make sure the binary hole at least covers the area where
pixels in the color source are "bad.. You might want to feather the grayscale hole image
so that there is a gray ramp that covers "good" pixels so that there is a nice transition
between the repaired pixels and the rest of the "good" regions.
You might say "Great, now I know how the grayscale image I provide is used to guide the
filling process. How do I visualize what RE:Fill is doing internally so I can work
intelligently." This leads us into a discussion of the display and render mode settings.

Process Mode: RE:Fill offers different display and rendering options, including ways to
look at how your grayscale hole images are being converted into the internal binary
images used for the filling process.

Filled Hole Only : RE:Fill lets you set the Alpha channel of the result with the grayscale
hole image you have provided. In essence, this mode displays the "filled hole only." This
mode allows you handle the cases when further processing is necessary on the filled
region before compositing back on the background plate.

Filled: This mode fills the hole and composites the filled result over the source.

Holes Over Source: This mode provides with a visualization of the areas the plugin will
be filling. With this mode, the red channel shows the binary image that has been created
from your grayscale hole image. Remember, it is this binary image that determines which
pixels are to be filled. Of course the area to be filled will change based on the Threshold
value you set. Using this mode you can make sure that everything in your color source
that needs repairing is covered by a red pixel.

en Holes Over Source is selected, the binary hole is shown in red over the color source.
e we show the binary source for the three threshold values used in the examples above.
e how the binary hole starts to be inside the light switch in the image on the right; which
ans all the pixels of the light switch will not be replaced as desired.

Holes : This mode helps you visualize how the new pixel data will be blended over the
background. As you saw in the example above, the actual blending of the filled region changes as
a fuction of the Threshold value you provide. The Holes setting allows you to see the actual
composite blending that will be used.

With the Holes setting you will see:

1. The binary hole, after thresholding, in the Red channel


2. All non-zero pixels of the supplied hole image (basically, this channel displays all
pixels of your grayscale hole image that can potentially be hole pixels, depending on the
threshold value).
3. The blending map for compositing the repaired color pixels onto the source color
image. Full-on pixels mean "take the repaired pixel" and full-off pixels mean "take the original
source image." Grayscale values inbetween do the appropriate blending.

n Holes is selected, you see the binary hole in the red channel, all non-zero pixels of the
grayscale image in green channel, and the modified grayscale image used for blending
yellow channel.

Holes: White?: If you check the box the software will consider holes to be black. Note
because the binary hole is, in part, defined by the Threshold value, that a perfect
negative is not created when turning this setting on and off.

Threshold: Threshold is provided in % (0-100) where a value of 50 corresponds to a


value 128 when working in 8 bits per channel (and a max of 255).
Hint : Be careful when creating your grayscale hole image. Some processes used to
generate a grayscale image can generate very low gray values that you might see as black,
and which would not be very important if we were simply compositing. However, although
the two pictures on top look very similar, note how different they when transformed into a
binary hole for RE:Fill. The top two images represent images to be used as holes;
however, the image on the top-right has been modified to remove near-zero values. When
we view the binary images created from the top two images (the binary image is shown in
the red channel), note how the bottom-left image includes many more pixels in its binary
hole image than the bottom-right image. In general consider that proper hole images for
RE:Fill should contain full white areas, potentially with smooth feather edges.

After Effects users: In After Effects if you reference another layer as the hole source
(that is, Alt Source not set to None), the effects applied to that Alt Source layer within the
same comp (like a feathering effect to expand a hole) will not show up in the RE:Fill
plugin. Any modifications you make to the hole image layer should be done in a pre-
composition in order to get the desired behavior.
RE:Fill Area Fill
Objective: To fill small holes in your image by replacing the pixels with values based on
neighbor pixels. Unlike a simple "bucket" fill, RE:Fill Area Fill allows you to create fills
based on the colors of the surrounding "good" regions.

This plugin addresses many different production problems.

• Area Fill allows you to fill in holes created when keying or rotoing out some bad
larger noisy blobs, scratches or other unwanted small objects.
• Area Fill allows you to fill in small image patches along an image boundary that
can become "invalid" after distorting or warping an image.
• Area Fill allows you to fill in an area between two objects you are lining up that
don't exactly fit together.
• Area Fill allows you to fill in areas that have unwanted blown out areas, or other
unwanted specks due to bad camera or lighting setup, or due to some unfortunate
color correction that has been applied. Combined with proper use of opacity and
transfer modes, Area Fill allows you to create nice color gradients and washes.
• Area Fill can help you fill in areas left behind after the removal of small tracking
markers, crosses or orange balls.

Controls:

HOLES Controls: These have been defined above . Note there is a Bypass mode in
Process Mode allowing you to turn off the filter on the frames that don't require hole
filling (of course, your host application must support animated pop-up menu settings for
this to be really useful).

Method: Filling comes in 3 flavors. All excel at filling small holes; but your results will
vary on large holes.
• Blended Neighborhood: Essentially performs the equivalent of a large Gaussian Blur (as
large as your hole) that takes into account that the image has holes in it.
• Nearest Valid: Replaces the pixel by the closest valid pixel to it in the picture.
• Mirror: Mirrors the pixel along the edges in the hole image.
• Blended Bounded: A specialized case of Blended Neighborhood to deal with the
situation of a source with no valid data on the frame edge. See illustration below.

Top-left: picture with missing data (extra large holes demonstrates the various filling processes).
Top-right: hole filled with Blended Neighborhood setting.
Bottom-left: hole filed with Nearest Valid setting.
Bottom-right: hole filled with Mirror setting.
Blended Bounded: This mode should be used when unwanted "leakage" of pixels in the interior of a hole
extends into an unwanted area (usually near the edge of the filled image). This leakage can happen when
there are no valid pixels on an edge of the frame. In this case we show a color source on the upper right,
and a hole image on the upper left. If we simply use the Blended Neighborhood setting, then the blue area
"leaks" into the outside filled region (at the edge of the image, on the right, you'll see some blue). When
selecting Blended Bounded the edge pixels (if part of the hole) are assigned the nearest "good" pixel color
before filling. (in this case, all the edge frames are closer to a red pixel than a blue pixel, so the result is an
exterior region that has no blue leakage.)

RE:Fill Area Fill has two more controls to manipulate your filling.

Smooth Color: Blurs the source color pixels before filling (blurring takes into account
that there are holes) . Softening is often desired for two reasons:
1) Smoothing can help reduce aliasing caused along a hole's edge due to the binary nature
of a hole.
2) Smoothing can also help to attenuate flickering from frame-to-frame that can be seen if
no smoothing is applied.

Left: hole filled with Blended Neighborhood setting. Right: picture blurred with a Smooth Color setting of 10. Note that there is not
that much of a difference when used with the Blended Neighborhood setting.

Left: hole filled with Nearest setting. Right: source picture pre-blurred with a Smooth Color setting of 10 before hole filling takes
place.
Left: hole filled with Mirror setting. Right: source picture pre-blurred with a Smooth Color setting of 10 before hole filling takes
place.

Smooth Direction: Using either the Nearest Valid or Mirror settings can produce results
where unwanted jaggies and discontinuities occur withiin the hole. The discontinuities
that can occur are typically a function of the hole shape and size. By increasing the
Smooth Direction setting you can create smoother transitions where these discontinuities
appear. In effect this setting smoothes the directions from where pixels are retrieved.
Smooth Direction has no effect on the Blended Neighborhood method.
In this example we will wish to fill in the black areas.
Hole filled with Nearest and Smooth Direction set to 0. Hole filled with Nearest and Smooth Direction set to 15.
Hole filled with Mirror and Smooth Direction set to 0. Hole filled with Mirror and Smooth Direction set to 15.

AntiAlias: Despite increasing Smooth Color or Smooth Direction you can still end up
with some staircasing which AntiAlias can often help attenuate. This becomes
particularly necessary when the hole is big. Look at the example below where the arrow
points.

These aliasing issues on the right were removed (as shown on the left) by setting AntiAlias to the Medium
setting.
Application Examples:
Below we present a number of novel uses of RE:Fill Area Fill.

Example : Smoothing badly exposed areas

Our source image has some bad exposure issues. Holes have been delineated for these regions. Of course this
filling works better on images with smooth gradients when the hole gets very large. Also remember that you
have the option of outputting only the filled hole, allowing you to control the transparency and the transfer
function back on a copy of the original. For example, playing with the transfer function of the hole
composited over the original would allow you to replace only the chrominance.
Example : Replacing scratches, wires and other small defects

Note here we purposely added some scratches (top left) to an image. The second row shows the original
image (before the addition of scratches), and after repair... the two are almost indistinguishable. The third row
shows a simple example of using RE:Fill Area Fill to create a base plate for a sky replacement (note: the
clouds are gone!). Picture copyright of Artbeats.
Example : Making arbitrary color gradients

From the four color squares we make this color gradient by applying RE:Fill Area Fill. The squares have an
alpha that is also used as hole source (the inverse of the alpha channel is the area to fill).
Example : Cool abstract imagery

Create some rich kaleidoscopic-like imagery with just a few simple animated shapes.

By default, filling large holes with the Mirror setting can exhibit hard discontinuities (left). These can be
taken care of by increasing the Smooth Direction setting. A Smooth Direction of 21 was applied to create the
image on the left.
Example : Make a full image from an element

When is the last time you had to animate particles? Didn't you wish your Z-buffer extended so that particles
that didn't hit the object still had a reasonable z-value? You can extend your Z map by applying RE:Fill Area
Fill.

Example : Moving something a few pixels ...


It can happen that you have to change the location of an object in a sequence. Let's say
you have an arm that passes just slightly over the label in your commercial. Sure you can
roto the arm out and paste it a bit lower in the iamge, but what do you do with the region
that remains after you've moved the arm?
We start here with an original
image (top left). We wish to
move the front arm down 10
pixels.

First, We cut the arm with a


matte (top right). Our intent is to
move it. When we move it we
will have a hole left.

So we take the invert of the


matte, grow it a bit so that when
we fill it we can create a blended
area between the filled hole and
the surrounding "good" pixels.
(the black areas in the middle-
left picture show the hole, which
is a slightly enlarged version of
the matte for the arm). The
middle-right picture
demonstrates just how much
we've grown the matte by
placing the arm back in the
picture, for comparison.

The last row, left picture, is what


we've built as a background
plate by filling the hole in the
middle-left picture. In this case
we used the Mirror Process
Mode. Then we repaste the arm
in the place where we'd like it.
Note where the fingers end up in
the first versus the last frame.
Example : Removing Markers
Starting Point: Here is a standard production problem. Here RE:Fill man has some marks
to remove on his costume (there is also some wire removal to do of course). Let's assume
we've pulled a matte for the green areas using chroma keying.

Original Image: provided by Tom Brigham tombrigham@gmail.com


Assume we've already pulled a matte for the green screen (the figure has been composited over another
background to demonstrate the keyed matte).

Removing the Markers: OK now we have a matte for our man but he still has some
black markers and lines on the costume. Maybe these black marks and black lines are
there to help to produce some CG effects (e.g., to aid in motion tracking). However, in
this example, the CG effects to be applied later will not be fully opaque, so the black
markers and lines on the costume need to replaced.
A second key is created, perhaps with a bit of roto-paint, to identify the holes; which include combining
the green screen chromakey, and the black markers and lines on the costume. Here we look at the results
using the Holes Over Source mode. Note that the red holes also include the area surrounding the person
(i.e., the green screen), and not just the black areas on the clothing itself because the holes touch the
silhouette of the element.
Now we fill the holes. This example makes it clear how you can create a temporary
version of your elements for creating glows, large blurs and other effects on an element
without introducing colors from the background plate.
To fill the black marks and lines on the person, we simply create a hole image by
smartly combining the matte for the green screen and the matte for the black markers on
the costume.
RE:Fill Offset
Of course there is a limit as to the usefulness of filling using the pixels surrounding a hole
(especially true for larger holes). Often times you are better doing a "Clone Offset"; that
is, getting pixels from another area on the same frame, or from another frame in the
sequence. As such RE:Fill Offset complements RE:Fill Area Fill. For example, a
common problem is to remove some objects from a scene where the camera is static or
slowly moving. In many cases it can be more straightforward to find the image data on
some other frame rather than trying to use the pixel values around our hole.

Objective of this plugin: Replace a region by copying a region from somewhere else in
the image, or copying a region from another frame at a different place in time.

With this plugin you define a place where the pixels are copied "from" (a place where
there are "good" pixels), and a place where the pixels are copied "to" (usually this place is
within a hole). In addition you need to define the hole image (as usual), a source (you can
use the same color source image sequence, or some other one) and, optionally, an
alternate time of the "from" frame.

Holes Controls: These have been explained in the first section above . Note there is a
Source setting in the Process Mode menu that allows you to view the Source after it is
moved into position but before it is cropped through your thresholded hole.

FILL

The process is to set some position for the source and some position for the destination.
Method: The only method currently supported is Clone-Offset. There is a Don't Fill setting
that enables you to turn off the filter off (which is useful when there are frames in the
sequence that don't need fixing. Keep in mind that not all applications allow you to animate
pop-up menus). Clone-Offset uses two positions; a Source Pos, which is moved to line up
with the Dest Pos.

Edge Alpha Handling: Options: Don't Fill, Flood, and Smooth Fill.
If the image your are using to offset has non-full alpha, then after the offset is applied you
may still have non-full-on pixels in your result. After offsetting to fill the hole, you can want
to fill the rest of the hole using an area fill (much like what's found in the Area Fill plugin).

• Don't Fill will do nothing. If after the offset is accomplished, and the offset
source image has a transparent area in it, then your final result might still have non full-on
pixels. This option will not do any further procssing after the offset is performed.
• Flood will make sure all alpha values are full on using a filling process similar to
that found in the Area Fill plugin. (You can use this mode when your source covers the whole
image but you want to use the mask tool within a layer to mark an hole. In applications like
After Effects or Premiere, this will save you a precomp. )
• Smooth Fill. can be used when the source you are moving
within the hole has some small holes in it but you still want the
final result to be full on alpha. Since the current image to
which the effect is applied can have it's own alpha, as well as
the selected source, and that both can be different than the hole
that is to be filled, be sure to play with these options in
conjunction with the Process Mode : Filled Holes and Filled
Holes Only, as well as the threshold value. The illustration
below compares Smooth Filling vs not when the source image
has a wide soft alpha edge.

Edge Behavior: Options: None, Duplicate Last, and Mirror.


When you try to position a background through a hole, you might end up moving the source
image so that the edge of the picture is positioned inside the hole being filled (for example,
this can easily happen because you are trying to take out an object in a scene; and in addition
to filling the hole you are trying to retain camera movement). When the edge of the source
image is positioned inside a hole, you can choose to do nothing (which leaves the hole
unfilled where there is no source image), or copy the edge pixels of the source, or to mirror
the edge pixels about its edge.

AntiAlias: Options: Normal, Sub-Pixel and Sub-Pixel + DeBlur.


This option allows you to choose to clone-offset with pixel precision (the Normal setting) or
at sub-pixel precision (Sub-Pixel and Sub-Pixel + DeBlur settings). When working at sub-
pixel resolution, if the displacement (between source and dest positions) is 0.5 pixels then
your source image will move by 0.5 pixels before being copied into the hole regions. The
trade off is that Normal, which works at integer pixel resolution, might create some visible
jumps, and Sub-Pixel might create some slightly blurry results. We also offer a third option
which works well on fast moving imagery called "Sub-Pixel + DeBlur" that tries to sharpen
the image after positioning it with sub-pixel resolution.

SOURCE

There are options that help you determine at which source sequence, and at which time, to
retrieve pixels.

Select ALT Layer. By default this is set to None, which means that "good" pixels are
retrieved from the image that is being repaired (presumably you would set Src Pos and Dest
Pos so that the hole is filled by another region of the image where there are "good" pixels.).
However, you may choose to use another image source sequence for retrieving pixels by
setting Select ALT Layer appropriately.

Use ALT Time. This option determines if the plugin should retrieve pixels from an image at
another time and, if checked, then Frame determines at which time. Note that we assume that
the first frame of a sequence is numbered 0 (not 1), regardless of whether the host application
starts numbering at 0 or 1.

After Effects Users: You will need to apply any effects in a pre-comp when Select ALT
Layer is set to something other than None, or if Use Alt Time is checked.

An example: Our visual effects supervisor is now asking to make Professor Pierre semi-
transparent... How are we going to do this? We have no texture under him! So we create a
garbage matte around Pierre and we get the pixels from somewhere else. The bluish beam on
the top right picture shows the offset that was applied (Src Pos is set to the right-hand side of
this beam and Dest Pos is set to the left-hand side of this beam). Our rotomask shape was
expanded and feathered, so that we set up a transition between the "good" pixels and the
filled region.
Of course, it's not always possible to repair images with only 1 application of RE:Fill Offset;
you often have to apply you corrections hole-by-hole, using multiple instances of RE:Fill
Offset. Since this is a filter effect you can quickly prepare your different holes and cascade
them within a layer using different hole sources.

Effects animators please take note, using RE:Fill Offset can be a rough and quick way to
generate color source layers for your particles.

Hint: Note on image sequences that have camera pans (and other camera movement where
the camera motion is roughly a global 2D move from frame-to-frame), you can often attach a
tracker on a part of the image that is "good" in order to track where your Src Pos and Dest
Pos move from frame-to-frame.
RE:Fill Frame Borders
Objective: To provide a quick way to remove the bad or black data on the edges of your
image. This includes dealing quickly with material of slightly different resolution (a
simple example being having some DV sources at 480 lines in a 486 comp), or handling
overscan data when scanning film, or even frame edges revealed by a small stabilization
operation.

Unlike the other tools in this set, in order to define a hole here, you simply set two points
to define an active rectangle and you select the proper filling mode: crop, color fill,
duplicate last pixel, mirror. The last two frame edge filling operations are available in the
other tools as "Edge Behavior". Don't sweat too much if you have irregular non-
rectangular edges and use RE:Fill Area Fill or Offset to do it.

Controls:

Fill Method

• Crop Alpha: Sets the alpha to zero outside of active rectangle.


• Edge Color: Fills the frame with the flat color as defined by the setting Edge
Color, which is set by you .
• Edge Duplicate: Copies the nearest valid pixel into the border defined by Upper
Left and Lower Right.
• Edge Mirror: Reflects the image about the rectangle defined by Upper Left and
Lower Right.
Here is our source image and then Next, we show the 4 different frame edge handling modes available:
A: Crop (note that the black areas also have had the alpha set to zero).
B: Edge Color; the edge color has been set to the green color you see
C: Edge Duplicate
D: Edge Mirror
Alpha: Ignore Current? : A special checkbox allows you to resolve the alpha ambiguity that
can result from wanting to expand the frame edges when you have a non-full alpha. This
provides the option to fill only RGB without changing the alpha (when this setting is checked )
or to overwrite the alpha will full-on values (if Alpha: Ignore Current? is not checked).

RE:Fill Dilating and Eroding Holes


RE:Fill provides two tools to grow or shrink the size of a binary matte (hole):
Grow/Shrink and Choke .

These tools allow you to expand or contract your matte in an intuitive manner, for
example if you key of noisy images you end up with garbage in the matte… The
Grow/Shrink tool is a “morphologic” operator that internally works on binary images and
works also optionally only horizontally, diagonally, vertically or on the whole image.
Alternatively you can also use our Choker which provides an intuitive pixel size amount.

In both cases, you often can use these before RE:Fill Area Fill when the hole is in the
alpha channel of the input, simply by setting the Output Write Mode of these to tools to
the Alpha channel.

Common to both Grow/Shrink and Choke.

Output Logic: “Difference” will display the difference of the result alpha with the
original alpha, instead of displaying the calculated result.

Output Write Mode: By default the mode is Write to Alpha, you can switch to RGB –
Fill Alpha so you can see what you are doing, and then when satisfied you reset the
Output mode to the appropriate channel, often alpha.

Grow-Shrink Holes Controls:

Shrink-Grow Mode: Depending if the ‘Shrink-Grow Size’ is under or over 0, you will
respectively shrink or grow.
• Shrink or Grow: if your size is 3, you will grow the shape by 3 pixels. It is
typically what you do to expand a shape by a pixel for hole filling purposes. For
example, you could grow your original matte alpha channel by 1 and set the ‘Output
Logic’ to ‘Difference” to create a line just past your matte in order to create a matte to
use to refill the content of that line.
• Alternate: Shrink-Grow,Shrink-Grow,… where the Size becomes the number of
iterations
• Shrink then Grow: if you set size to 3, it will Grow 3 pixels then shrink 3 pixels. It
is typically what you do to cover little holes within a matte.

Process Neighbor Mode: Allows you to grow only on specified axis.


Feather size: A value of 0 has no effect, creates a soft edge without flattening the
existing “white” values. (You can also use the “choker” control).

Choke Holes Controls:

Choker is used primarily to deal with the alpha edge when keying. This plugin works on
binary images meaning that it expects that the task is to edit a full-on matte. The principal
difference is that Choker will grow or shrink in anti-aliased way. It will support larger
values then Grow/Shrink and will animate smoothly.

Choke Amount : is the amount of pixels to eat in (negative value) or grow (positive
value). Note if your source is inverted (e.g/ black is your shape on white, simply reverse
the logic – negative to grow).

Hints:
1) You cannot grow alpha on an image where the RGB is already pre-multiplied as you
would reveal black. To do such thing you have to first create a fully filled RGB plate with
RE:Fill
RE:Fill Alpha
Finally we provide a little utility that might not be as useful as one thinks initially. It’s a
tool for checking and manipulating the alpha of your images. For example, this is useful
to check your images against possible unwanted premultiplications or divisions by
alpha(unpremultiplying). It also includes modes to handle RGB and Alpha mismatch.
For example a graphics render can leave values in the color channels which when
accessed later as an individual channel can have unexpected values.

In brief: the color value might already have the alpha weight applied to it. Systems that
work in premultiplied space then can simply throw to the viewer the RGB value without
having to multiply the color by alpha every time in order display appropriately. In less
theoretical terms, typically one wants to manipulate color using straight color values
(without the effect of alpha). For example, usually the output of a keyer is straight so
that color and matte manipulation can be done. Then when applying later operations, like
compositing or blurring, data would then need to be premultiplied. So it’s not that straight
or premultiplied images are better than the other (and in floating point the conversion
from one to the other is lossless). The controls should be self explanatory except for
Demult (screen) which is a special mode for image sources without an alpha channel.
Let's review them shortly and follow with a real example.

Clean Color: Makes sure all zero alpha pixels have black as rgb values

Divide: This mode divides the rgb value by the alpha values, taking your images from
premultiplied to “straight” space. For example if you import an alpha image sequence
separate from RGB sequence and your host application runs in “straight” mode by
default, this mode will be of use to you get your images into “straight” space.

Premult: This is the opposite of Divide. This mode multiplies your images by the alpha
channel and is designed to take your images from straight to premultiplied space.

Fill Alpha: this mode fills areas of 0 alpha value from areas of the image with non-zero
alpha. Think about this mode as a growing and expanding the image from the non-zero
alpha values, so that the final result has no zero-alpha pixels). This can be useful to fix a
matte when the color values are not available anymore.

Fill Non-Full Alpha: will replace the color values where alpha is not full by color coming
from full alpha parts of the image. The end result retains the original alpha values of the
image.

Full Alpha: simply set Alpha to Full on.


Demult (screen): this mode takes an rgb image and creates an alpha based on luminance,

Above is an example. Note this process works best in floating point. (Image provided by
Luc Froehlicher - alamaison.fr ). On the left an image source without an alpha, in the
center we apply Demult which makes an alpha based on the luminance but resets the
color channel so visually there is no impact on what it looks like. The right is the result
straight RGB values (which you can see by setting the viewer to Straight mode or simply
applying another copy of the plugin and set Full Alpha as mode.
Application Example: Keying and RE:Fill Alpha

In this example we received a sequence of images which has RGB in one sequence and
alpha as a separate sequence. This is material provided by a company that the producer of
the show outsourced to the Production Monkeys.

All the Production Monkeys had to do was shoot some green screen footage and give us
the results with the material already keyed. And the Production Monkeys have been fired
and can’t go back to the original source footage.

Note: the material was not provided in the form as in the picture above. I am using a
reference source green screen image to check the damages.

Opening the file, and placing the alpha in the color layer, we already see a few things. For
example there is a strong edges issue around the actor. Also, obviously a despill was
applied since the face color slightly changed.
The black fringes around the person are suspicious, so the first thing we do is apply
RE:Fill Alpha and check if the image needs to be unpremultiplied or premultiplied. That
was it! We needed to premultiply it (mode Premult). Now let's look at the alpha in more
detail.

Here as a quick spot check I composite the provided image, with matte, over a copy of
that layer where I applied RE:Fill Choke with 10% Threshold Point and I just set the
mode to "Write to RGB- Fill Alpha" (which writes the calculated alpha channel to the
RGB as well, which is why white pixels are revealed). What this does is convert all the
alpha values over 10% to white and the others to zero. Obviously I see the mattes have a
lot of semi-transparent blotches. Why does it matter? These low transparency areas are
still not completely transparent (and 10% is quite high) – and these pixels that might not
be very visible now, might become an eyesore after more compositing or color
correcting. These problems tend to grow in this age of high-dynamic range and floating
point image processing.

Let's remove the second layer that we were using to spot check (where we created a white
under-layer), and just set RE:Fill Choke back to Write to Alpha. Now, we see the image
above. These colors in the background are revealed more clearly as the alpha is now full.
FYI, the colors in the “background” area are not green, because the person who keyed
this originally performed a despill color correction while keying. However, many of the
pixels in the background we’d like to get rid of completely. So let's try to use the Choker
to get rid of that problem.
So we apply the Choker and the extra pixels over the background (that were originally
not keyed out) do go away but we had to Choke so much that now our foreground looks
like a bad cut-out and the hair is now really ugly. So that's not the complete solution.

So what to do?: First we dial back how much we choke the alpha. Then, on the left we
applied RE:Fill Alpha , mode: Non-Full Alpha, (by itself) to our badly keyed matted
image. Note that all the extra artifacts from the original key in the right image, within the
top left corner (dark specs and such). These are gone in the image on the left. I feel better
already, my matte has been decontaminated. Anything else I can do to make it look
better?
Here on the left I applied the RE:Fill Alpha two times. One time with mode Fill Non-
Zero Alpha (to mean fill the color where Alpha is semi-transparent) then I use Fill Alpha
(Fill From Alpha). On the right I only use Fill Alpha. Why am I doing this? Well I am
trying to get rid of that bad video compression edges on the actor’s edges.

So here (on the right I use the Grow slider adjusted to -3, minus grows inside) and
therefore filled over the edge with colors from inside the matte. This can also be done
with more controls in RE:Fill Area. Then I simply composited the right side result over
the background using the original matte I had which has now all been decontaminated.
Notice the edge of the shirt is a lot less visually objectionable then where we started.
So finally you might ask. Can't I just blur the matte a lot (which the right image shows).
Note the "noisy stuff" that comes back to haunt us. The picture on the left is a much
better result using the RE:Fill tools as described

Copyright 1999-2010 RE:Vision Effects, Inc.


For technical support email to techsupport@revisionfx.com
Visit us on the web to find out about updates at http://www.revisionfx.com.

You might also like