Anatomy of a MSG Effect

I recently was asked how the image above was created. It was generated from a source image of a face that was processed in Studio Artist using a 2 step Paint Action Sequence (PASeq). Both action steps in the PASeq are custom MSG presets I constructed that work together to build the overall BW sketch effect.

The PASeq is a factory preset in Studio Artist 4 called Circle Rendition2, so the effect itself is just one of the thousands of preset effects that are built into Studio Artist. But i thought it would be instructive to delve into the construction of this particular effect in detail to give a feel for the hidden power that lurks within Studio Artist.

MSG stands for Modular Synthesized Graphics and is Studio Artist's modular image processing architecture. In version 4 there are over 500 different MSG image processing modules (called processors) that can be configured together to build an infinite variety of different image or video processing effects.

The particular effect discussed in this article is a black and white sketch effect composed of 2 different internal components. They are a thin line sketch that accents facial features and a mass rendering sketch composed of small black circles. These 2 individual stylistic components work together to build up the overall sketch effect. The Circle Rendition2 PASeq preset is shown below, and you can see that it consists of 2 different MSG action steps.

The thin line sketch is actually based on a MSG processor that solves the traveling salesman problem, but instead of generating an optimal travel route between cities it is plotting an optimal sketch route that travels between different facial features. So it's acting like an artist that does a complete sketch by placing the pen on the canvas and then doing a full sketch while never lifting the pen until the sketch is completed. So the entire sketch is composed of only a single continuously drawn path.

The mass sketch component is again based on a different MSG processor, one that tries to represent the mass of an image using individual black circles placed according to an apollonian packing scheme.

The screenshot below of the MSG Advanced Editor shows the processor chain used to construct the first thin line sketch MSG preset.

The TexFV processor is used to generate a texture or edge map from the source image. The Threshold processor then is used to clip the edge map image output of the TexFV processor. By adjusting the Threshold parameter associated with this Threshold processor you can change the complexity or detail of the sketch. The 1CAbstract6 processor is what generates the traveling salesman sketch based on the clipped edge map input image. It's parameter controls are shown below.

The final 1to3 processor just maps the single channel output of the 1CAbstract6 processor to the full RGB color output channels for the MSG preset.

To recap, the green channel of the source input to the MSG preset was processed to generate an edge map, that was then clipped and used as an input to a path generator that connects all of the clipped edge points in an optimal continuous path. The generated path is the thin line sketch effect. An example of the output from this particular MSG preset effect using a different source image is shown below.

Note how the sketch tries to travel to all of the image feature points without lifting the pen. This particular source image also had a lot of edge detail located at the boundaries of the image. You could use additional processing to remove those features from the sketch if desired.

The second MSG preset used to construct the mass sketch based on apollonian packed circles is very similar in nature to the first preset described above. The preset' processor chain can be seen below.

A key difference between this preset and the previous one is that an edge map is not constructed as a part of the effect. Instead the processing takes place directly using the green source channel as input to a ThresholdRamp MSG processor. Again, the previous preset was trying to generate a sketch to represent the source image details (or edges) while this second preset is trying to represent the mass (or luminance) of the source image with black circles. The ThresholdRamp processor acts to boost the contrast of the mass sketch. By adjusting the Threshold and Radius parameters you could control the amount of contrast enhancement, or dial in a more linear tone range to the sketch.

The 1CAbstract7 processor is what generates the apollonian packed circles. Apollonian packing is a mathematical technique for optimally close packing circles into a constrained area, and has a nice stylized appearance. The output of the ThresholdRamp processor is the input to the 1CAbstract7 process that renders it's input using apollonian packed circles. If you didn't care about contrast enhancement you could skip the ThresholdRamp processor step and just use the source image as a direct input into this processor. Again, the last step is a 1to3 processor which just maps the single channel output image into a 3 channel color output for the MSG preset.

The output of this second MSG mass sketch preset is shown below.

Pay close attention to the packing of the circles. the circles touch but never overlap. The final sketch output from the 2 MSG presets discussed above working together to build a finished sketch effect is shown below.

The more technically sophisticated reader may be wondering why the green source channel was used for creating the 2 component sketch effects since it's not really the source luminance but just a crude approximation. You could easily modify these 2 presets to work off of the source image luminance directly. To do this, you would use a RGBtoYIQ processor as the first step in the processor chain, and then use the Y channel output as the input for the subsequent processing steps.

Also, there's no reason why you couldn't construct a single MSG preset that incorporated the internal components of both of the presets described above into a single preset. But the nice thing about using a PASeq to build up an effect like this is that you can work with a library of MSG presets that are easy to understand and build up specific components that work together to create a more complicated effect. Building the PASes is as simple as running the individual processing effects one at a time while PASeq recording is turned on.

Labels: , , ,