Connecting visual effects & animation professionals.
  Signup    Login


Custom Channel Separations
1:50 PM on Fri 3 Oct 2008
Filed under: Software Related


alt

A Frequency-Based Custom Channel Separations workflow

I would like to share a technique I have been developing in my compositing work, and explore how it might be expanded or improved for use in Shake or Nuke.  The original idea came from Photoshop expert Greg Apodaca, a photo retoucher now working for Apple.  Thanks Greg!  Greg's website has some excellent examples of how he has used the technique in print work.  http://www.gregapodaca.com/

The advantage of this approach is that it allows direct manipulation of texture, color or shading independently of each other

A perfect example of its usefulness in compositing is the case of shadows moving over a textured surface, such as a sidewalk, or a person's clothing.  Using this technique, you can easily add, remove or edit shadow shapes without having to worry about the surface texture.  Likewise, you can edit the surface texture without regard to whether it is in light or shade at any given moment.  You can clone texture between lit and shaded areas freely.  This works equally well for cloning film grain from one area of an image to another, solving the problematic grain-matching situation of an extremely soft-edged composite.

alt  
before
alt  after

The technique, as it exists now, involves running images through Photoshop and using the High Pass filter to separate high frequency luminance information (texture) from low frequency luminance information (shading).  An optional step separates color information from the frequency channels, leaving them monochrome.


Once the separations have been created in Photoshop, I can re-assemble the layer stack in After Effects (because it supports the "Linear Light" and "Color" blending modes), but I have not succeeded in Shake or Nuke.  This is an area where I would love to have some help. 

My ultimate wish would be if this workflow could be incorporated into the compositing tool as a native environment.  Similar to the way you can switch between color spaces, I would love to be able to switch into Frequency Space.


Download a psd:

Probably the most intuitive way to understand this process is to open a document and play with the layers.  Download this psd file: http://www.foggybog.com/hipass/bricks_01.psd and open it in Photoshop.  Be sure to open your Layer Comps palette for guided navigation.

The top layer is the original image.
The second layer is a folder with the three custom channels.
The third set is identical to the second set, but with additional layers used as temporary aids.

alt



Roll Your Own:

One objective in creating these new channels, is that the resulting stack of layers should add up to exactly* match the source image.   To this end my basic strategy is that when a layer is created, its inverse is subtracted from the base layer.  The base layer I call "Shading" once the texture and/or color are subtracted.

So, the steps used to create the frequency separations are as follows:

1.  Open an image in Photoshop.

2.  Create the Texture layer:
Duplicate the background layer and apply the Other>High Pass filter with a setting of 2 pixels.  Set the Blending Mode to Linear Light, and set the opacity to 50%.  Name this layer "HiPass 02". 

3.  Subtract the inverse:
Duplicate HiPass 02, move it directly above the background layer, and invert it.  Call this layer "HiPass 02 inverted".  Duplicate the background layer and merge these two new layers.  Call the resulting layer "Shading".

4.  Take the remaining background layer and move it to the top of the stack, for "before and after" comparisons. 

You now have a simple frequency-based separation. 

The optional step of creating a Color layer would happen before the first texture layer.  To create this, bucket-fill a copy of the background to fill the entire screen with 50% gray.  The trick here is that the Paint Bucket tool is set to Luminosity Mode.  Set this layer to "Color" blending mode, at 100% opacity.  The inverse is subtracted at 50% opacity, leaving a monochrome base layer.  (I am curious what effect the sRGB space might be having on this part of the process.)

The High Pass value of 2 is arbitrary for this example.  Values from 1-20 or more may be useful.  It is also possible to split the image into multiple layers by degrees of texture.  (see below) 


* - Ideally, the new channels would add up to exactly match the source image.  There are a few scenarios where this does not happen.  I would like to solve this.  For example, near-white or black single pixels are getting clipped to gray values.  Larger areas of white or black are unaffected, but single pixels are getting whacked for some reason.  Another situation is when more than one level of texture is extracted, there seems to be a density shift of the stack.  I have a feeling this has to do with the sRGB color space.


As many levels as you want

Here is an example splitting into four layers with High Pass values of 2, 5, 20 plus the base shading layer.  http://www.foggybog.com/hipass/water_01.psd

alt  source
alt  High Pass = 2
alt  High Pass = 5  (minus High Pass 2)
alt  High Pass = 20  (minus High Pass 2 & 5)  I had to take it this far to get rid of the dark spots visible here.  Compare this image with the Shading image below.  The Shading image is now fairly flat, making cloning much easier.
alt  Shading  (what's left after all High Pass layers are subtracted)  Easy to clone out the dark "wetness".



Here I was able to create the illusion that the water had dried, leaving a stain, by editing the Shading layer and then replacing the texture layers.

alt




Problems and Questions:
– There are several steps here where I am not clear on the math involved.  There may be better ways to do things.
What algorithm is Photoshop using for its High Pass filter?  There is more going on than just a High Pass convolve.
How can I re-create Adobe's "Linear Light" or "Color" blending modes in Shake or Nuke?
What effect is the sRGB color profile having on my workflow?
– Can I re-create this in a linear color environment?
What are the reasons that layer stacks do not always equal the source? 

I would appreciate any comments or suggestions on any aspect of this.

Thanks!

--David






Back to DavidAughenbaugh's Blog     Report Inappropriate Content

Comments (1)
Anonymous - 9:11 PM on Thu 16 Oct 2008  [ message ]
Wow thanks David!

Forum - Sketchpad - Secret Chatroom - Invite Using an Email Address - Terms of Service - FAQ - Contact Us




©2010 vfxConnection.com