Monday, October 8, 2012

Working with Gradients & Blends

Gradients and blends play a prominent part in the artwork produced by many digital illustrators, and ever since blending and gradient modes have been available there has been one persistent problem with their display and output. The problem is banding. Although banding can occur in raster-based software programs like Adobe Photoshop, banding is much more prevalent in vector-based programs like Adobe Illustrator.


Banding is the visible appearance of marked steps of color within a gradient transition. It can be though of as seams within a supposedly seamless progression from one color to another. Banding can be quite pronounced or very subtle. It can occur in linear, radial, or customized shape blends and gradients. And it can happen both on computer displays and in print.

Example of banding produced by a gradient. 

The Banding Frustration

Banding is device resolution dependent. In other words, banding conforms to the device that is producing it, so a banded pattern that occurs in a specific gradient on a computer monitor, can have a different pattern when the very same gradient is output as a digital print.

Dealing With Banding

The best analogy I can think of to compare to banding is the medical condition diabetes. Once you get it you can manage it, and with certain treatments it may go into remission or appear to be unnoticeable, but it will never go away completely. In the digital world we call these treatments “workarounds”. Workarounds are ways to improve a situation in an indirect manner. I have tried many ways to deal with banding throughout successive updates in software, display and postscript technology. Here are some of them and their results.

Using Short Distance Gradients/Blends
This works when it can be done, but it can’t always be done when a specific visual effect is needed in an illustration. I’ve found that there is no length formula to guarantee a perfectly smooth result every time. It all depends on the particular makeup of the colors used in the gradient.

Increasing Contrast In Gradients/Blends
The gradient contrast is the percentage ratio between the starting and ending colors in the gradient. Again, this works when it can be done, but this could result in changing the desired color scheme in an illustration, and for the sake of a workaround this might not be desirable.

Choose Colors Less Likely to Band
Although this is offered as a workaround for banding, I haven’t experienced or found any consistent information about “banding proof” colors, or even about colors that are guaranteed to band.

In the Too Much Information Category
Of course there is the myth of Pantone Reflex Blue when it comes to bad colors; in CMYK (100C, 90M, 30Y, and 8K); in RGB (0R, 32G, and 159B); in Hex for the web (#003399). Reflex Blue has long been thought of as a cursed color, and it seems this has carried over to the digital world. In printing inks, Reflex Blue is one of the 14 Pantone base inks that are used to mix the other colors in the Pantone Matching System. Printing inks are real substances made of minerals and pigment, and there is validity to the fact that Reflex Blue is actually less stable and predictable to print with than the other Pantone base colors. However interesting this may be, it has no validity in the digital world, where there is no Reflex Blue pigment, and it doesn’t even exist in inkjet or process color printing. So the most likely candidate for "color guaranteed to band" is out of the running.

Using CMYK as a Solution
Using CMYK can in some color combinations reduce banding. I have had success by creating colors that have some percentage of all of the CMYK colors. A purple that is primarily magenta and cyan but has a marginal amount of yellow and black will gradate better than a magenta/cyan purple. In other words, four channels blending over a distance will perform better than two.

Eliminating the Zero Factor
Now this solution may be a bit controversial, but it has worked for me, particularly when it comes to an aspect of banding I call “white cutoff”. Essentially, rather than having a zero factor for any of the components of the colors used in a gradient, I enter a value of one or two percent. In most situations it is undetectable by the viewer, but I have found that it does smooth out a gradient toward the light end. White cutoff is the point where the output device makes the decision to stop dispensing ink or cuts off the color in a blend. Some output devices will cutoff one or more colors and continue on toward white with only one color. So for example, there will be a faint red haze at the point a colored blend becomes white. When this happens it can be quite conspicuous and absolutely ruin a print. Eliminating the zero percentage prevents this from occurring.

Illustrator Options

Using an Imported Smoothing Overlay
This method involves creating a flat color or grey tone file in Photoshop, adding noise to it, saving it and then placing it into an Illustrator image as an overlay. The downside to this technique is that it adds a raster element to a vector file, and however it is applied, either with a multiply or an overlay blend mode, it does alter the gradient below.

Rasterizing a gradient component in Illustrator is an option, and in some circumstances a simple rasterizing of an object such as a background can help, but after the gradient is rasterized, Illustrator doesn’t have too many options to work with it.

Using Effects
Illustrator doesn’t offer a Noise Filter, but it does have a Grain Effect. And through the effects options window the Grain Effect applied as an overlay can be controlled to simulate the look and effect of a Noise Filter. I’ve found this method of smoothing gradients to be the best solution for improving the smoothness of a gradient while staying in Illustrator, and without altering the color base of the gradient. A raster operation, the Grain Effect, can be so subtle it is virtually undetectable when the image is output.

The Blur Effect is another option for smoothing out a gradient. Also a raster operation, Blur interpolates the color pixels in proximity to one and other to give a smoothing appearance to color transitions. Blurs tend to effect the edges of shapes, so while banding can be smoothed out within a shape, the colors surrounding the edges of the shape will be pulled into the shape.

Importing Gradients From Photoshop
To avoid banding, some printers advise illustrators and designers to create their gradient blends in Photoshop and then import them as separate pieces to be placed and masked in Illustrator. This may be ok for one or two blends, but this process can get quite tedious if you have a number of blends you need to produce.

Exporting an Illustrator File to Photoshop
The final option I’m going to discuss, which is the option I prefer, is to export the entire Illustrator file to Photoshop. Photoshop displays a wysiwyg, “what you see is what you get”, view of your image and it offers the ultimate image editing control and options to adjust anything that doesn’t look right. Individual blends can be smoothed in a number of different ways, and global solutions for improved output can also be applied. The most effective global solution for banding is to add noise to the file just before final output. A noise level set to 3 is usually enough to smooth out gradients and color transitions without being noticeable in print. I have used this simple method for many years with great success. As another option for smoothing, Photoshop also provides a dithering option when needed. The dithering option works very well with gradients created in Photoshop.

This 11" x 17" editorial image uses radial and linear gradients as well as 
custom blends with overlaps. © 2012 Don Arday.

Here’s why Photoshop is a better visualization source for gradients. Photoshop displays images in pixels, and each pixel is computed and accurately represented. Illustrator displays an interpretation of an algorithm, and that algorithm is dependent on whatever device is displaying or outputting it. The device computes the transition, so its appearance of a gradient or blend can change between how it appears on a monitor and how it appears on whatever device is used to generate the output of the image.

Postscript Level 3

In 1997 Adobe released Postscript Language Level 3. Level 3 included a "smooth shaded gradients" function that interpreted gradients as control points, colorants, and spaces to be filled. Smooth shading has greatly improved the output of blends, but certain shadings are application and output device dependent, so in those cases banding can still occur. Here’s what Adobe says, Conceptually, a shading determines a color value for each individual point within the area to be painted. In practice, however, the shading may actually be used to compute color values only for some subset of the points in the target area, with the colors of the intervening points determined by interpolation between the ones computed,” (Adobe Systems, “Postscript Language Reference, 3rd Edition” 5. 263).

In Conclusion

The variables that go into the possible causes of banding are too great for any one universal solution. Like most working methods used to create illustrations and designs, the best solution to a specific problem will come down to a personal work preference.