日本語版 →

Dithering and Gradients — Getting Smooth Shading From Few Colors

Pixel art always drags the same dilemma along with it. The fewer colors you use, the easier the piece is to place tile by tile, and the tighter it tends to look as a drawing. But cut too far and a sunset sky or the shading on a cheek breaks apart into thick stripes, like a chocolate bar snapped along its grooves. "Add more colors, or live with the stripes" — for decades pixel artists have answered that apparent either-or with a third option. That option is dithering.

This page walks through what dithering actually is, the standard patterns, where it helps and where it actively hurts, how to place it by hand, and how to recover when banding has already appeared. What follows is not a tour of one tool's buttons — it is general pixel art technique that applies anywhere. On top of that, we will look at how it combines with the conversion settings and editing features in Heartopia Design Studio.

1. Why banding appears in the first place

The photo or illustration you start from usually carries 256 levels of brightness per channel. A gradient sky moves through dozens of distinct blues from top to bottom. Convert it to pixel art, though, and the palette collapses to somewhere between a dozen and a few dozen colors. When 256 steps become 10, the jump between neighboring steps grows roughly twenty-five-fold. That is the physical cause of banding.

The awkward part is that the human eye exaggerates those steps well beyond their actual size. Vision emphasizes the boundary wherever two surfaces of different brightness meet — the effect known as Mach bands. As a result, even a numerically tiny step reads as a bright line or a dark trough along the seam, as though someone had drawn an outline there. The wider and flatter the surface, the more obvious it becomes. That is exactly why banding bothers us most in skies, walls and water.

So banding is not only a problem of "not enough colors." It is also a problem of the eye amplifying the shortage. Which is precisely why a remedy that has nothing to do with adding colors — a remedy that fools the eye instead — works so well.

2. How dithering works — letting the eye do the mixing

Dithering means alternating two colors in a fine pattern so that an intermediate color appears to exist. Lay a dark blue and a light blue out in a checkerboard, step back, and you see a medium blue — even though not a single tile of that color was ever placed.

The reason is the limit of the eye's spatial resolution. When detail sits below what the retina can resolve, the brain cannot separate the individual points and instead processes the region as an average color. This is not an exotic illusion; it is a principle we rely on every day. Color printing builds every intermediate shade purely from the density of tiny cyan, magenta, yellow and black dots. Displays are nothing but rows of red, green and blue subpixels — there is no white emitter anywhere on a white screen. Dithering simply applies that same "density stands in for intensity" idea to a grid of pixel art tiles.

Dithering multiplies your effective color count

Here is the key point. Given two adjacent colors A and B, varying the dither density lets you manufacture extra apparent steps between them. The most workable ladder is five rungs: 100% A → 75% A → 50% (checkerboard) → 25% A → 100% B.

A100%    A75%     A50%     A25%     B100%
■■■■■   ■■■□■   ■□■□■   □■□□□   □□□□□
■■■■■   ■□■■■   □■□■□   □□□■□   □□□□□
■■■■■   ■■■□■   ■□■□■   □■□□□   □□□□□
■■■■■   ■□■■■   □■□■□   □□□■□   □□□□□

Only two colors are in play, yet the eye receives five levels of brightness. If your blue ramp holds five colors and you insert those three intermediate steps between every adjacent pair, five colors behave like a seventeen-step gradient. That arithmetic is why dithering earns its keep whenever you cannot add colors but still need tonal range.

One precondition to remember: dithering only reads as a blended color when each tile appears small enough. On a display where the dots are rendered large, or when you are peering at the screen from close range, the pattern refuses to merge and simply looks like a checkerboard. Get into the habit of zooming your browser out, or holding your phone at arm's length, to check how the piece reads at the distance it will actually be viewed from.

3. The standard dither patterns

Checkerboard (50%)

The most basic pattern and the one you will reach for most often: two colors alternating strictly every other tile. The density is exactly 50%, so it reads as the precise midpoint between the two colors. Its period is only two tiles, which makes it easy to fit into narrow areas.

■□■□■□■□
□■□■□■□■
■□■□■□■□
□■□■□■□■

25% / 75% (sparse dithers)

Here one color occupies just one tile in every four. It blends far more gently than a checkerboard, which is what you want when you need to nudge a surface only slightly toward its neighbor. Placed at the edges of a gradient — where a flat area hands off to a dithered band — it softens the seam. The 75% pattern is simply this one with the two colors swapped.

25%              75%
■□□□■□□□     ■■■□■■■□
□□■□□□■□     ■□■■■□■■
■□□□■□□□     ■■■□■■■□
□□■□□□■□     ■□■■■□■■

Bayer (ordered dithering)

Ordered dithering, usually called Bayer dithering, is the systematic version of everything above. You prepare a small matrix of fixed numbers (a threshold matrix) and decide each tile's color by asking whether its brightness exceeds the threshold stored at that position. The 4×4 Bayer matrix looks like this.

 0   8   2  10
12   4  14   6
 3  11   1   9
15   7  13   5

Tile that matrix across the canvas, apply the rule "lighter than the threshold takes the light color, darker takes the dark color," and the method automatically produces seventeen density levels from 0/16 up to 16/16, tracking brightness as it goes. The 25%, 50% and 75% patterns are just three of the densities this machinery emits. It produces a regular mesh, and because the period is fixed, it can be reproduced by hand — a substantial advantage. That characteristic crosshatched look in the skies and floors of retro games is almost always ordered dithering.

Error diffusion (Floyd–Steinberg and relatives)

Error diffusion works on an entirely different idea. It resolves one tile at a time, and the discrepancy between the brightness it wanted and the palette color it was forced to use — the error — is distributed into the not-yet-decided neighbors to the right, lower right, below and lower left. The errors end up cancelling one another locally, so the overall average brightness stays remarkably close to the original image.

For reducing photographs it is far and away the highest-quality approach, but as raw material for pixel art it is awkward. The pattern it emits is irregular, and with no regularity there is essentially no way to redraw it by hand. Because the tiles read as scattered grit rather than as an intentional motif, work meant to be placed one tile at a time by a person often ends up looking coarse rather than smooth.

MethodAppearanceHand reproductionBest used for
Checkerboard (50%)Orderly gridVery easySeams between two colors, mid-tones on a surface
25% / 75%Sparse specksEasyJoining flat areas to dithered bands
BayerRegular meshPossible (learn the period)Skies, water, continuous tone across wide backgrounds
Error diffusionIrregular grainPractically impossiblePhoto reduction, print work

4. When to dither, and when not to

Dithering is not a universal upgrade. Misplace it and it reliably lowers the quality of the drawing. Two factors decide: available area, and display size.

Where it pays off

Where to avoid it

The single most common mistake is blanketing the whole canvas in dithering because it "somehow looks skilled." Dithering is a technique for making things less conspicuous, not more. If you want one part of a drawing to be the focal point, it is far more effective to leave that area as a flat, undithered surface and put the dithering only around it.

5. Placing dithering by hand, step by step

The conversion in Heartopia Design Studio, together with noise reduction and color reduction, pushes the image toward cleaner, simpler color. Think of dithering as something you add back on top with your own hand. The pen in design editing mode lets you place tiles one at a time, freely. Here is the working order.

  1. Choose the two colors the dither will bridge
    From the surface you want to grade, pick two adjacent tones. The closer their brightness, the more convincingly they blend; the further apart, the more they read as a lattice. Two colors that sit one step apart on the palette are ideal.
  2. Settle the shape of the boundary first
    Dithering is a technique for softening a boundary, so if you do not know where the boundary was before you softened it, the whole drawing loses its form. Block in the two colors flat first and confirm that the silhouette works.
  3. Lay out a band along that boundary
    Picture a band roughly four to eight tiles wide, straddling the boundary line. All dithering stays inside that band.
  4. Divide the band into three zones
    Put a 50% checkerboard down the middle, 25% on the lighter side and 75% on the darker side. The result is a five-step run — flat → 25% → 50% → 75% → flat — and the seam stops announcing itself.
  5. Follow the contours on curved surfaces
    On a sphere or a cylinder, run the dither band as a curve that follows the roundness of the form rather than as a straight line. If the band does not trace the shape, the result reads as a flat surface with a pattern stuck on it, not as a volume.
  6. Check it from a distance
    When you finish, always look at it zoomed out. If you can see grain, the dither is too strong — lower the density or narrow the band. If you can still see the step, widen the band.

While placing tiles, the per-color highlight display earns its keep. Highlight just one of the two colors in the dither and you can see at a glance whether the lattice lines up cleanly and whether the period has drifted. Block work mode advances in blocks of 10×10 tiles, which pairs well with a two-tile checkerboard period or a four-tile Bayer period and makes it easier to avoid a pattern shifting at a block seam.

6. What to do when banding appears

When stripes show up right after conversion, there is no need to jump straight to redrawing with the pen. Work through what the settings can do first.

  1. Ease off step 2 of color reduction
    Very often the stripes come from merging similar colors too aggressively. Relax the merging of similar colors and the intermediate tones come back, making the steps finer. The color count rises, but as long as you stay within 15–25 colors the impact on your actual tile work is small.
  2. Ease off noise reduction
    Setting noise reduction to Strong can flatten the fluctuation within a gradient, which paradoxically leaves the boundary between steps sharper and more geometric. If stripes bother you, drop back to Weak or Medium and compare.
  3. Reconsider the conversion method
    Method 2 (illustration / simple) and Method 3 (high contrast) both lift contrast, and they lift the tonal steps right along with it. When smoothness matters more, returning to Method 1 (standard) usually calms things down.
  4. Or go the other way entirely
    Instead of chasing every stripe, you can push merging harder, cut the ramp down to three or four levels, and commit to crisp cel-shaded blocks of color. It is the half-hearted step that reads as a mistake; a decisively separated surface reads as a style.
  5. Finally, add dithering with the pen
    Break up whatever obvious step still remains with hand-placed dithering. In most cases a single troublesome boundary is all that needs treatment, not the whole surface.

One more idea worth having in your kit: change the shape of the step itself. Banding is unpleasant because the seam between tones is a straight, geometric line. Redraw that line as something meaningful — the edge of a cloud, a clump of leaves, the irregularity of a rock face — and it stops being a stripe and becomes description. Overlapping the boundary with clouds in a sky, or with the line where grass meets ground, is the classic move.

7. Telling grain apart from dithering

When you look at a conversion and see scattered specks, being able to tell whether you are looking at dithering or at plain noise keeps you from treating it wrongly. The two look similar but call for opposite responses: noise should be removed, dithering should be preserved.

AspectDitheringNoise from conversion
ArrangementRegular, with a periodIrregular, no period
Colors involvedEssentially just twoOften three or more mixed together
Where it appearsAs a band along a tonal seamScattered without regard to the subject
ShapeForms a checkerboard or meshIsolated specks of one or two tiles
Correct responseKeep it (removing it brings the stripes back)Remove it with noise or color reduction

If you cannot decide, use the per-color highlight display to isolate a single color. If those tiles line up in a neat lattice it is dithering; if they are scattered at random it is noise.

Note that the processing applied to an uploaded image assigns palette colors and tidies up noise — it works in that direction. So grain visible immediately after conversion can safely be treated as noise stemming from fluctuation in the source image, not as intentional dithering. Clean it up with noise reduction and color reduction without hesitation, and then add dithering yourself, only where you want tonal range. That order is the most dependable route to smooth gradients on a small palette.

The situation is different if the source image already contains dithering — a retro game screenshot, say, or an image someone else already reduced in another program. From the converter's point of view that dither pattern is just rapid color switching, so it can be treated as noise and broken up. When working with material like that, keep noise reduction at None or Weak and choose a precision (dot count) close to the source image's own dot count; the pattern is far more likely to survive.

In summary: dithering is a technique for having the eye do your mixing instead of spending palette entries. It works on wide surfaces and backfires on small pieces. Use it between two closely related colors, never between distant ones. And rather than blanketing the canvas, place it as a band only along the boundaries that need tonal range. Hold on to those four points and you can produce surprisingly smooth work while staying within the 15–25 colors that suit pixel art.