Joe Maller: FXScript Reference: Building Joe's Color GlowHow I built my FXScript color glow filter for Final Cut Pro. |
|
|
Visit the New FXScript Reference and Joe's Filters sites. These pages will be phased out soon and may already be out of date. This page describes the FXScript concepts behind Joe's Color Glow. If you're looking for the page about how to use this filter, click here. OverviewThis filter works by selecting a color and then applying a modified and filled selection back onto the original image. Several relatively simple operations are combined to create a complex effect. The filter uses a keying operation to build it's initial selection, and all of the various options modify that selection. There are four main steps to Joe's Color Glow:
Channels: The Key to KeyingAfter working with digital images and Photoshop for a long time, I've come to believe there is no diference between a selection and a greyscale image. Everytime something is selected in Photoshop, a temporary grayscale image is created corresponding to the selected area. The color glow effect is based on a selected area. That selection is then modified, filled and composited back onto the original image. Since my selections are based on a selected color, I could extract the alpha channel generated by FXScript's My First YUV headacheThis filter was the first where I encountered how YUV and RGB color spaces interact in FXScript. The filter does almost all of it's work in the RGB255 color space. I followed the lead set out in all Final Cut Pro's built in keying filters, which all convert to RGB before keying. I think the reason for converting color space is to match the the color picked on the RGB monitor to the results on the video output. Selecting an RGB color and applying it to a YUV key results in different keyed areas between the desktop preview and video output. The variable
I'm not sure if the pixel format is stored when the The more I use this, the more absurd it seems. The code How it worksSince each color conversion must be wrapped in an if/else statement to prevent double-conversions, the filter's source code looks worse than it is. The variable The code below uses
That might not be the most efficient way of getting information into xbuffer. When I have some time, I'm going to look at other ways of accomplishing that. Next the script converts the orinal image to RGB255 to prepare for keying. I put this into an if/then statement to be safe even though all DV source starts as YUV219. RGB255 is the same format as the desktop display so the keying operation will match up between the video output and the desktop preview. The end goal of this code block is to get the image content of src1 (the original clip) into
Now
I've got a selection, now what do I do?After establishing the selection, the script applies various effects to it before compositing back onto the image. One of the simplest things to do is inverting the alpha channel of the image buffer which will be composited later. Below is a short if statement which will invert the channel based on the setting of a checkbox. Because the keying operation masks the area around
ConclusionI borrowed code from several of my other filters for many of the options in Joe's Color Glow. Other changes to the composite image include pre and post blurring and a thresholding operation borrowed from Building Joe's Threshold and Posterize. My standard set of compositing controls finishes the filter. The complete FXScript source code for Joe's Color Glow is included with the paid version of Joe's Filters. |
The FXScript ReferenceFXScripting Joe's FiltersJoe's Filters for Final Cut Pro Building Joe's Minimum Maximum Joe's FXScript ExplorersJoe's Debug and Explore Filters Joe's 3x3 Convolve Matrix Tester Joe's 3x3 Matrix Values Tester Other FCP Stuff
Film & VideoRecording the sound of PhotographyProjectsFinal Cut ProDesignWRITINGSite Notes Archive (weblog) Web ResourcesAbout Joe MallerPast Home Pages Etc.Search joemaller.comContact Me
|