Weekly Newsletter!

Sign up for Mac Alert, the weekly newsletter from the producers of Creative Mac. You'll get news, reviews, features and tutorials, all delivered to your e-mail box.

Sign up now!

 

Our Related Sites
Digital Producer
Digital Video Editing
Millimeter Magazine

Video Systems
Our Related User Forums

Creative Mac
Adobe Premiere

Mac Sites We Like

Ramseeker PowerBook CentralMacinsteinLowEndMacMacs OnlyMacWindowsGo2MacMacSpeedzoneMacReviewzone

Want to see this tutorial on one long page? Click here.

TUTORIAL FEBRUARY 27 , 2001
How To Make Your Own Adobe Premiere Filters

Part 1: Getting around the Premiere Filter Factory

by David Nagel
Executive Producer
[email protected]

Very few of you Premiere 5.1 editors out there, I'd wager, have ever given Premiere's Filter Factory a second thought. If you've ever selected it in the Filters window, you probably either figured it doesn't do anything or dismissed it as being way too complex to waste your time on. Wrong on both counts. Premiere's Filter Factory is very similar to the plugin of the same name found in Adobe Photoshop. That is, it allows you to enter in parameters for visual effects and then save these as a completely separate plugin, one that bears your name and copyright information. Basically, it provides the engine for creating your own keyframable Premiere filters, which you can then reuse and even redistribute to your colleagues.

And you don't even have to be a programmer.

Two problems: First, there's little documentation available that can be read and understood by someone as hammered with work as most video editors are. Second, the final appearance of the filter's interface isn't all that pretty. Well, I can solve both your problems. In this installment, we'll take a look at a few basic functions in Filter Factory just to get you understanding how things work. In the next installment, I'll show you how to clean up the filter's interface so that you can proudly distribute it with your own custom look—logos, company information, pictures of Charisma Carpenter or whatever else you Premiere folk want to look at while you're applying effects to your videos. We'll then continue on in the series with more complex operations that will give you some different effects.

Before we go on, I should note that I've also recently written a tutorial on the Adobe Photoshop Filter Factory. They're not the same, but this other tutorial might help you, if you'd like to go that route. You can find it here. I should also note that I'm writing this tutorial for Premiere version 5.1 because I have not yet received my copy of version 6 from Adobe. It should work the same, but I wouldn't know.

What am I looking at?
The first thing you'll see when you open up the Filter Factory are many things that don't make a whole lot of sense right off the bat.


The default Filter Factory window.

The most dominant features of the interface are the four big text fields labeled A, R, G and B, with the text a, r, g and b, respectively, entered into the fields. These are your channels. The text fields are for entering equations that tell Premiere what to do with these channels—invert them, add noise to them, turn them into pinwheel spirals, etc. (Now, whether you're making spiral or checkerboards or whatever, judgments in good taste are for you to make. I'm just going to show you what things do to get things happening.)

You'll also see eight sliders next to four different labels (Map 0, Map 1, etc.). These sliders represent values of 0 to 255 and replace the variables you enter into your equations. So, if you want your red channel (R) to fade in or out, you just tell Filter Factory to take a value for R from one of the sliders. When the slider is at 255, the red channel is fully visible. At 0, it's completely invisible. Simple, huh? Obviously, this isn't all there is to it, but that's basically it. Sliders control your channel values. Now it's up to you to tell the sliders HOW to control your channel values.

Things you need to know
To help you along, you're probably going to want to print out this tutorial because, as you know, you can't toggle applications once you're in Premiere's Filter window, which means you can't keep referring back to this Web site while that window is open. Also, sadly, you can't paste my equations into the Premiere Filter Factory. You're going to have to type them in manually. But don't worry. I'll keep these ones short. In the end, you should feel confident enough to mess around with your own equations. Click here to see this tutorial on one long page for more convenient printing.

Before we get started here, you need to know what we're going to be working with. So here's what we're working with today, along with a little explanation of each thing.


  • The sliders in Filter Factory are referred to as controls, abbreviated "ctl," followed by a number representing the particular slider. They are numbered 0 through 7, rather than 1 though 8. Ignore the "Map" labels. They don't mean anything for this tutorial.
    Operators (+, -, /, *): For operations, we simply use +, -, / and * (addition, subtraction, division and multiplication, respectively). So, 3*3=9.
  • Sliders (ctl(0) though ctl(7)): To specify which slider you want to have control over a particular aspect of your equation, signify the control as ctl(0) through ctl(7). That's eight controls, numbered 0 though 7. So, if ctl(0) is set to 3 and ctl(1) is set to 3, then ctl(0)*ctl(1)=9.
  • Pixel Coordinates (x, y, X, Y): We're also going to be using x, y, X and Y. These represent horizontal and vertical pixel coordinates. Lowercase x and y represent the current position of each individual pixel. Uppercase X and Y represent the edges of the image. So, if you want to move all of the pixels in your red channel, for example, you could write "x-3,y-3" in the R field. This will shift your red channel down and over by three pixels. Or you could write "x-ctl(0),y-ctl(1)," which would shift your red channel down and over a number of pixels equal to the current value determined by the position of the first and second sliders.
  • Function (src): Now, we also have to use a couple of functions. Literally just a couple in the beginning. The first one is src. This src function is just used to tell Filter Factory where it's supposed to pull its pixel information from, namely your image. So, instead of simply writing "x-ctl(0),y-ctl(1)," you write "src(x-ctl(0),y-ctl(1)). It's basically just a formality, but you have to do it to get this to work properly. One other thing you have to do is to specify a channel in your src expression. This is simply a matter of placing a number 0 though 3 at the end of the expression so that it looks like "src(x-ctl(0),y-ctl(1),1)."
  • Function (rnd): Finally, for this tutorial, we will introduce the random function. This is a great one for generating noise effects. Basically, all you have to do is write something like rnd(1,30) to generate a random number between 1 and 30. Of course, you can use controls instead of absolute numbers. In other words, something like src(x-rnd(ctl(0),ctl(1)),y-rnd(ctl(2),ctl(3)),1), which will offset your pixels by a random number between the values set by your sliders. Quite handy for bringing in gradual noise.

So these are all the things you have to know to get started. So let's get started.

Example 1: hue shifting
Just to start off, so you can see that this thing actually works, go into the Filter Factory in Premiere and set the R, G and B text fields to ctl(0), ctl(1) and ctl(2), respectively. Then play around with the first three sliders. Notice something? You're just getting solid colors. But when you move the sliders back and forth, the color changes depending upon the value for each channel.

Neat, but useless. So let's add in some practicality. This time we're going to try a hue shift. All we have to do for this is is take the default value of each cannel and add or subtract some slider values. So the red channel, for example, will read "r+(ctl(0)-ctl(1))." Try entering the formulas you see below.


Using the first six sliders—ctl(0) though
ctl(5)—to create a hue shift filter.

That's a hue shift filter. All it's saying is take the numeric value of the red, green and blue channels and add one slider value while subtracting another. In the case of red, we have the first slider—ctl(0)—minus the second slider—ctl(1). So whenever ctl(0) and ctl(1) are equal, you wind up with your original channel value. When ctl(0) is at 0, then ctl(1) is subtracted from the initial channel value. When ctl(1) is at 0, then ctl(0) is added to the initial value.


Video hue-shifted using Filter Factory.

You've just written your first filter. It doesn't do much, but it is keyframable, so you can cycle through hues just by changing the slider values as various keyframes. If you want, you can now save this filter to be used later. (See below for further instructions.)

Example 2: channel shifting
That wasn't so painful. Now let's try building upon this. Instead of changing the intensity of the individual channels, let's instead change the position of their pixels. In other words, we're going to separate the channels to achieve a sort of bad video effect that will have a look similar to a 3D movie.

Here, instead of using the values r, g and b in our R, G and B fields, we're going to use "src." To accomplish this, we need only state the x and y coordinates to which we want each channel's pixels to move—dynamically and interactively, of course.


The channel-shift effect.

Your formula will look like this for the R channel: "src(x-ctl(0),y-ctl(1))." This will allow you to shift the pixels in the R channel a number of pixels equal to the value of the first two sliders, ctl(0) and ctl(1). Try entering these formulas:


Using the first six sliders—ctl(0) though ctl(5)—to
create a limited channel shift filter.

Note that when you use this formula, you only get a shift to the right or down. But, as we saw in the previous example, we can add one slider while subtracting another to get a full range of motion. So now try changing your formulas this way:


Adding additional parameters to the formula
for a broader range of motion.

As you probably noticed, we're a bit limited by the number of sliders available to us. Not to worry. A single slider can control multiple channels or multiple coordinates. You still don't get the full range of versatility that you might want, but you can simply create additional filters to cover all the possibilities.


Channel shifting can create ghosting and bring in
artifacts for "bad video" effects.

The output is similar to what you created in the previous incarnation of this channel-shift filter. It just gives you more options. It can also allow you to "bloom out" a sequence for a sort of transition that throws each channel individually off the frame.

Example 3: bring in the noise
In our final beginning example, we'll introduce the concept of random pixel offsets. Using the random, or "rnd," function, we can tell Filter Factory to shift individual pixels in our video by a random amount in between two numbers we give it. These two numbers can be either static or dynamic (based on slider values), depending on how much control you want.


Our video with simple noise applied.

The advantage of random values is that it creates noise in the channels that can have some pretty slick results when combined with standard channel shifting, which we learned in the previous example. To generate a random value, instead of using, for example, x-ctl(0), you would use x-rnd(1,30) to generate x minus a random number between 1 and 30. Or you can generate a random number between two controls, such as x-rnd(ctl(0),ctl(1)), which generates x minus a random number between the values of ctl(0) and ctl(1).

Let's try it out. We're just going to modify the formula above thusly:

Now rather than watching our channels shift, we're watching them shift as they break into particle-like noise.

Now try mixing up all of the examples we've put together. Use a hue shift formula in the R field, a channel shift in the G field and a noise formula in the B field. Or use a channel shift in an x coordinate and a noise generator in the y coordinate, such as R: "src(x-ctl(0), y-rnd(ctl(1),ctl(2)),1)." Or some such. Try different operators as well. Try multiplying and dividing, for example.

Of course, this isn't all the Filter Factory can do, but it will give you a start in terms of figuring out how to make things happen. In another tutorial, we'll look at more complex functions, as well as methods of passing and returning data.

Saving your filters
The real power of Filter Factory is in its ability to save your settings and build them into new filters for future use. If you had to enter a formula each time you used the thing, it would be pretty cumbersome.

The process of building a filter is quite simple. Just click the "Build" button, and a dialog pops up. Take a look at the screen below:

As you can see, all you have to do is enter names for your sliders, copyright information and the name of the actual filter as it will appear in your Filter window in Premiere. If you build your filter and save it into your Plug-Ins folder, all you'll need to do is quit and relaunch the program to access it again. Note that the positions of your sliders when you build the filter will become their default positions the next time you use the filter (first keyframe and last automatically). So make sure they're in a position you like.

Finally, you can also save your formulas by clicking the "Save" button. This can come in handy if you want to build multiple filters off a basic set of formulas so that you don't have to keep entering the numbers manually. And remember that once you build a filter, you will not be able to go back and change the formulas in it.

In our next installment, we'll take a look at a simple Mac-only method for adding a little graphical customization to the filters you've created. Following this, we'll look at some more advanced formulas to use. Until then, play around with some numbers on your own. If you're feeling awfully confident, check out Harald Heim's article on the Premiere Filter Factory at http://www.thepluginsite.com/knowhow/ffpg/ffpg.htm. Or read my tutorial on Adobe Photoshop's filter factory at http://www.digitalmediadesigner.com/2001/ 02_feb/tutorials/filterfactory/filterfactory-page1.htm.

GO TO PAGE [ 1, 2, 3, 4, 5, 6, Complete, Home ]

Post a message in the Creative Mac World Wide User Group.


Dave Nagel is the producer of Creative Mac and Digital Media Designer; host of the Creative Mac, Adobe InDesign, Adobe LiveMotion and Synthetik Studio Artist WWUGs; and executive producer of Creative Mac, Digital Media Designer, Digital Pro Sound, Digital Webcast, Plug-in Central, Presentation Master, ProAudio.net and Video Systems sites. All are part of the Digital Media Net family of online industry hubs.