Showing posts with label marbling. Show all posts
Showing posts with label marbling. Show all posts

Sunday, April 15, 2012

An Anatomy of Painter's Brushes, Part 5

Liquid media was always visually stunning. During the Painter 5-7 timeframe, my work on the brushes literally went into a different dimension, a different state of matter. In the Painter 7 timeframe, Corel had taken it over and was just beginning to pwn it. In those releases I created some of the most interesting brushes ever to be created, and some of the most useful and expressive brushes.

I have talked about the Painter 6 brushes, with the bristle brushes that got their own life, the line airbrush, the spatter airbrush, and the pattern pen. But before those new brush engine additions, there were some very interesting developments in Painter 5.

Liquid Media Take 1

One class of brush was made up by the liquid metal and the water drop brushes. These were actually dynamic plugins, which featured their own layer (or layers!) and a dialog with the ability to draw and adjust. The really cool thing was that these brushes produced objects that were editable. I have done this before, with the mosaic brush, and I like the model somehow, because it extends the possibilities available to me.

What makes this tick? ...you might ask. Well, when I was touring with Painter 5, I made no secret of the fact that I was using two-dimensional metaballs to achieve the look.

Without getting into details, each dab of the brush is really just a procedural point with a radius and a height. You can, for instance lay down some liquid metal and put another drop next to it and watch as they merge into a single droplet. Then you can adjust size, volume, and smoothness to create different looks with your drops. This was the ultimate in procedural description, allowing non-destructive editing. But of course, liquid metal wasn't the only look. There was also another aspect to it, refraction.

The most cool thing about refraction was the possibility of creating the look of water droplets. We often showed this when we toured with the product. You can see that the picture behind the liquid layer actually refracts and is visible inside of each droplet. I was able to use my experience in the early 80s with building ray tracers to figure out how this could be done.

Notice also that each drop can reflect an environment map on its surface. This complexity and depth lent itself to quite a visual interest. This in combination with the blobby combination of the droplets in a smooth, seamless result gave the user something to think about.

I was always interested in the look of raindrops on glass. As a child, when we drove across country, I would look through a water drop endlessly. Hey, my brothers thought I was peculiar.

So, for Liquid Metal, I created a Rain button. This randomly deposited drops onto the layer. And as they land, they merge like real raindrops. Eventually it fills up with a wavy surface. Use refraction to see what's underneath it. Here I placed some red text in the background. The refraction produces wavy letters that match the reflections in the surface. Think of it as your private ray tracer. With a brush.

But, speaking of the brush, you can use it to create the same look, but under your direct hand control. Here, a tartan weave fills the canvas but the liquid metal stroke (which is mostly transparent and thus looks like clear gelatin squeezed out of a tube) shows the refraction of the weaving.

There was a theme going: take the paint and use it like a three-dimensional surface. In Painter 5, we had the ability to create impasto. Although we were just beginning to work on it and it would become a truly great feature of Painter 6, you could see the value in it in the can image.

The Painter can hero image showed impasto effects, and we even had to relax them a bit so they wouldn't get too pronounced. I did the graphic of the Painter 5 can with the impasto surface.

We were always doing something with the paint can, since it was our product's identity and brand mark. More liquid brushes were featured in Painter 5's palette. And these were quite familiar to the users of Kai's Power Goo. Use a brush stroke to stir the surface of your painting like it's made from liquid itself. Bulges, spirals all of it can be done there. It merely works like a vector field, with each pixel containing a two-dimensional displacement that yields where the source pixel comes from, or at least the vector from the pixel to the source point.

Painter 5 also contained some new brushes that were more conventional because they operate directly on the canvas. For instance the Turbulence brush is a great way of stirring an image like the cream in a coffee. What it does is to place many dabs of the brush randomly into the image (using jitter, of course), where each dab contains a spiral distortion.

This brilliantly simulates turbulent flow, which actually is decomposable into a series of vortices. Actually, that's exactly what the brush does as well! It pays to read up on vector fields.

Painter 5 also contained brushes for dodging and burning, for sharpening and softening, and also for creating a very brushy smear.

These brushes, like Grainy Mover and the like all use Cellular automata at their core. While other brushes, namely the distort brushes actually were based on marbling. An example of hand-marbled texture is seen here, using Distorto at a large scale, first passed one way, and then perpendicular to it. Several times. Each time, the pattern gets more complicated and more folds appear. Like the finest steel that is tamped and folded over again and again to create a very hard and sharp edge.

So the liquid brushes in Painter 5 utilized a range of technologies to accomplish their liquid looks: cellular automata, vector field advection, ray tracing of reflections and refraction, and two-dimensional metaballs. Friends John Derry, Udo Gauss, and Alex Hsu were all witness to these brushes while in development at Fractal Design.

Liquid Brushes Take 2

During the Painter 7 development period, some new liquid media were developed that really provided some visually beautiful results.

The basic technology of two-dimensional metaballs was to build up a height field with small functions, perhaps a little like dabs of the airbrush, and create a floating point height field that could then be zerosetted to produce liquid-like edges. But In Painter 7, I added a color value to the height field so that each pixel could have a color. When the dabs intersected, their colors would have to intersect and interpolate as well. This created a bit of color bleed where the ink intersected. The edge of the ink was hard-edged, using a similar technology to liquid metal, and the same blobbiness and merging is present, but the colors mix in a more diffuse way when the broad ink strokes meet.

Unlike Liquid Metal, this brush could work with bristles and it had a secret weapon: resist. With resist, you can paint with negative ink. This removes the ink and can thin out areas to create more of a suggestion of the actual ink strokes. It is the equivalent of working scratchboard with ink again. But really, infinitely adjustable.

Here, liquid bristle ink strokes are gone over with liquid bristle resist, which carves away the strokes. But the heavy strokes remain longer than the light ones. This is because the liquid ink actually uses a height field. Such a technique, if done even better, might be good for sgraffito strokes as well, where multiple colors can get revealed depending upon how deep you cut with the resist.

I suppose at some point I will have to go into watercolors.

Wednesday, March 7, 2012

Marbling

In Painter 4, we came out with several new features. One was mosaics. Another was marbling. Marbling is the application of drops of colored ink onto the surface of a liquid, playing with the ink, and imparting that color imagery onto a piece of paper. Marbling was used in the industrial revolution to make the frontispieces of books.

This technique was a bit of a lost art because the people who created them actually figured out the process and kept it secret in an unusual way. They constructed several rooms. Each one had an artist that knew his part of the process. The artwork (and sometimes a pan of liquid ink) was passed through a slit in the wall in between the rooms. After several rooms, the finished piece would emerge. In this way, no single person knew the entire process and thus its creator could keep it very secret.

The first step was dropping various colors of ink onto a liquid surface called a size. Why it's called that, I will never know. As you drop a bit of ink down, all the other bits of ink are distorted by the new drop. This creates a very interesting pattern, called stone.

Here you see a stone pattern constructed by dropping a lot of drips of ink onto the liquid surface of the size.

The stone pattern is the undistorted pattern that is used as a colorful basis of the marbling pattern. This stuff can be created in a simple way, using a conformal mapping. Let's say the new drop has radius R. We preserve the area of the colors already on the size by displaying them from the center of the drop, altering the distance function of the color you fetch using a function of R, and also of D, the distance of the pixel you are computing from the center of the blob. In this way, you can evaluate the entire stone pattern using a ray-tracing technique where all the drops of ink are taken into account for every pixel of the image.

This is done in the Painter Esoterica:Blobs... effect. That's actually how I created this image.

The second step taken by the artisans (in a separate room, and by a separate artist) was to run pins and rakes through the liquid, further distorting the ink in interesting ways. They usually moved the pins and rakes in a sinusoidal pattern.

Here you see the result of one pass with a rake. The source image was a colorful soft spiral of purples, greens, white, and browns. You can see the rake was passed from left to right. The sinusoids are quite pronounced. The ink sticks to the rake tines and gets pulled in the direction that the rake is pulled.

This is how the marbling patterns are created, by distorting the colors of the image, creating a cool-looking pattern.

This is how it starts, but the various marbling formulas usually feature several passes.

After three passes, and using a very special formula, you can get some very nice patterns, like this bouquet pattern.

It starts with a very fine rake vertically from top to bottom, and with very small tines so the distortion is just enough to create a small high-frequency pattern.

Then two larger vertical sinusoids are used to mix it up, using a widely-spaced rake with large tines. This results in the bouquet pattern you see here.

You have probably seen these marbling patterns in the old books. Binders like them a lot.

There are literally dozens of interesting marbling patterns, and each has a cool formula. Many of them are programmed into Painter as presets.

Painter still has this marbling command, Esoterica:Apply Marbling...

Here is another bouquet pattern, with different placement of the widely-spaced vertical rakes. I think I considered this to be one of the better results in the bouquet class of marblings.

You can get thistle patterns by passing one rake vertically, and passing another in between the lines of the other one in the opposite direction (this pulls up and down the ink, in alternating sections). Then you can bouquet it.

When you use circular patterns with the rake, it gets even weirder, but Painter can't do that with its Apply Marbling... effect. There might just be a bit more to explore in marbling.

This is an experimental design done by using the Blobs... effect. Here, the ink blobs were filled with an image (the pattern source) instead of a flat color. This can create some really interesting patterns, as this shows.

Use the right colors and it pops! it comes alive with vibrance. But it's a little disconcerting, since it seems to be alive and organic somehow.

The implementation of marbling was also a bit of a raytracing trick as well.

When distorting an image, all distortion functions must run backwards. This is because you are enumerating all output pixels and trying to find the source pixel for that output pixel. This is the reverse from simply taking a pixel and moving it from its source to its definition.

So the marbling implementation was really just iterating over every pixel and computing a function going from the displayed pixel to the place where it came from.

Graphics programming can be a bit complicated sometimes.

When Painter 4 came out, as far as I know, it had the first computer implementation of marbling and stone patterns ever.

It was fun figuring it out, and I always did like to show new things.