Deluxe Paint Gradient Fills

So I watched Mark Ferrari's entire GDC talk "8 Bit & '8 Bitish' Graphics-Outside the Box". It's a fantastic talk by one of the greatest pixel artists alive today. He talks about a lot of his work, and spends a section of the video going into some details about his techniques.

I tried to follow along as best I could in his tutorial sections using Grafx2. Unfortunately, there are a few things that Deluxe Paint and/or Pro Motion can do that Grafx2 still can't. One of those things I'd really like to use is Deluxe Paint's gradient fill modes.

So I've been trying to dissect the way Deluxe Paint does its shape-conforming gradient fills, and seeing if I can implement them myself in Grafx2. (Grafx2 also a has an existing feature request that mentions this functionality: Add more flexible gradients)

Here's what I'm up against:

Menu of different Deluxe Paint fill modes

Findings

"Contour" fill

Contour fill

The key here to replicating some of DP's odd behavior is that it's always using the most distant edge. This is why DP's fills look a little weird when the fill wraps around curves (where it has multiple edges to choose from along some lines coming from the center.

From our top-right example, we can see how this breaks down. The gradient is being done based on the most distant edge, so it's affected by the hook shape.

Contour fill example 2

And the bottom-right example. We can clearly see where it's preferring far edges to interpolate to.

Contour fill example 3

"Highlight" fill

I believe this is identical to "Countour", but with a different mapping to the actual gradient. t may be affected by a curve, similar to a gamma curve. So I'm not going to cover this one here.

"Ridges" fill

Ridges fill

"Linear" fill

This is a pretty basic linear gradient fill. Grafx2 already supports this, so it's only here for completeness.

"Circular" fill

This is a basic radial gradient. Grafx2 already does this, too, so we won't get into it.

"Shape" fill

Shaped fill

This one is like the "contour" fill, except that it uses a line instead of a single centerpoint. We'll do the same math as before, but with an extra projection. Rather than a single mid-point, as used in the "contour" mode, we need to use an entire line.

Shaped fill description example

It'll work exactly the same as the contour gradient, except that we need to find the closest point along a given center line, and use that as the A vector in the equation.

Results

So far I've only worked on figuring out the "contour" fill mode. My results are looking pretty promising, though! Here's what my prototype spits out with the same image input (slightly different points selected as centers):

My own contour gradient fill implementation results

It doesn't match the DP results exactly, but that's more a matter of correctly mapping the gradient to color values than anything to do with the technique.

Next update will probably focus on the "shaped" mode and optimizations.

Posted: 2021-08-09

Tags: grafx2