The Math Behind Halftone Dot Patterns
Explore the algorithms, screening, and dithering techniques that turn images into dot patterns.
Ever wondered why some dot patterns look smooth while others look strange? There's real math behind it. Let me take you through the algorithms and concepts—no calculus required, I promise.
Why Math Matters for Dots
Here's the thing: halftone isn't just "make dots where it's dark." There are genuine computational decisions about:
- How big each dot should be
- Where exactly to place it
- How to avoid weird patterns
- How to fake smooth gradients with binary dots
Understanding this helps you make better choices when using our Dot Art Generator and troubleshoot when something looks "off."
The Core Concept: Optical Mixing
Your brain is the secret ingredient. Halftone exploits how human vision works:
When dots are small enough and viewed from a distance, your brain averages them together. Big dots = dark. Small dots = light. No dots = white.
This is called metamerism—your eyes blend discrete elements into perceived continuous tones.
It's the same principle behind TV pixels, pointillist paintings, and retina displays. Just at different scales.
Dot Size Math
The basic formula is surprisingly simple:
dot_radius = max_radius × √(darkness)
Why the square root? Because we're filling area, not lines. A dot that's twice the radius has four times the area. The square root keeps the relationship between brightness and ink coverage linear.
In our generator, when you adjust "pixel size," you're adjusting that max_radius value.
AM vs FM Screening
There are two fundamental approaches to halftone, and they look quite different:
AM (Amplitude Modulation)
Traditional halftone. Dots are placed on a regular grid, and their size varies.
- Bigger dots = darker areas
- Smaller dots = lighter areas
- Regular, predictable pattern
This is what most people picture when they think of halftone.
FM (Frequency Modulation)
Also called stochastic screening. All dots are the same size, but their distribution varies.
- More dots = darker areas
- Fewer dots = lighter areas
- Random placement, organic look
FM screening looks more photographic but lacks that classic "comic book" pattern.
Our generator uses AM-style dots because that's the aesthetic most people want for pop art.
The Dithering Algorithms
Here's where it gets interesting. How do you decide which dots to place when you're converting a continuous-tone image to binary dots?
Floyd-Steinberg Dithering
The most famous algorithm. It works by diffusing error to neighboring pixels:
When you process a pixel:
- Decide if it should have a dot (above or below threshold)
- Calculate the "error" (how far off you were)
- Spread that error to nearby pixels
- They factor it in when making their own decisions
The result: errors cancel out across the image, creating smooth gradients from binary dots.
In our generator, Floyd-Steinberg is the default because it produces the most natural-looking results.
Atkinson Dithering
Similar to Floyd-Steinberg, but it spreads less of the error (about 75% vs 100%). This creates:
- Lighter overall images
- More contrast
- The classic Mac OS look (Bill Atkinson created it for early Macintosh)
Great for high-contrast images or when you want that retro computing aesthetic.
Ordered (Bayer) Dithering
Uses a fixed threshold matrix instead of error diffusion. Each pixel is compared against a recurring pattern of thresholds.
The result:
- Consistent, repeatable patterns
- Geometric/crosshatch appearance
- Very fast computation
Looks more "artificial" but has its own charm—especially for game/tech aesthetics.
Threshold (No Dithering)
The simplest approach: above threshold = dot, below threshold = no dot.
- High contrast
- Posterized appearance
- Works best with already high-contrast images
Try this when you want maximum graphic impact.
Screen Angles and Moiré
When printing multiple colors, each color gets its own halftone screen. If these screens overlap at wrong angles, you get moiré patterns—weird wavy interference.
Traditional CMYK angles:
- Cyan: 15°
- Magenta: 75°
- Yellow: 0° (or 90°)
- Black: 45°
These angles minimize interference. When you see weird patterns in color halftone, misaligned screens are usually the culprit.
For single-color dot art (what most people create with our generator), this isn't an issue—but it explains why color printing is trickier than it might seem.
Resolution Math
A practical formula for quality halftone:
Source resolution = Target LPI × 2 (minimum)
Where LPI (Lines Per Inch) is your dot frequency for printing.
For screen display, we work in pixels per dimension instead of LPI, but the principle holds: higher source resolution = more detail in your dots.
Putting It Into Practice
You don't need to do the math yourself—the Dot Art Generator handles all of this automatically. But understanding helps you make informed choices:
- Floyd-Steinberg: For smooth, natural-looking gradients
- Atkinson: For lighter, more contrasty results
- Ordered: For geometric patterns
- Threshold: For maximum contrast, graphic look
- Bigger pixel size: Fewer, larger dots (more abstract)
- Smaller pixel size: More, smaller dots (more detailed)
The Beautiful Part
What makes all this math beautiful is that it disappears when you look at the result. You don't see algorithms—you see a photo transformed into pop art.
The math serves the aesthetics. And when you create something that makes people stop and look, no one asks about the dithering algorithm.
Ready to experiment? Try different algorithms in the Dot Art Generator and see the differences yourself. Or check out how famous artists used these techniques in their work.
