Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 36 ยท Logos and Icons

Icon Design: Pixel Grid, Keylines and Stroke Rules

Design crisp icons in Adobe Illustrator: pixel grid, Align to Pixel Grid, keyline shapes, consistent stroke weights and corner radii, with runnable Python stand-in checkers.

An icon is a logo's small cousin: it must be recognized at 16 or 24 pixels. At that size, a line that straddles two pixels turns into a blurry gray smear. Illustrator has settings that keep vector icons crisp, and design rules that make a set look consistent.

Illustrator does not run on this site. The Python code is a stand-in that models the pixel math; it is not Illustrator.

Set up the document

  1. File > New, choose the Web profile or a custom size such as 24 x 24 px for one icon (or 512 x 512 for a large working size).
  2. Set color mode to RGB and raster effects to 72 ppi (the default for screens).
  3. Turn on View > Pixel Preview (Alt/Option+Ctrl/Cmd+Y) to see how the artwork will rasterize.
  4. In Preferences > Guides & Grid, set Gridline every 1 px and Subdivisions 1; turn on View > Show Grid and Snap to Grid. Or keep Snap to Pixel on (View > Snap to Pixel).
  5. Use the Align to Pixel Grid checkbox in the Transform panel for each shape, or choose it when drawing shapes (New Document dialog: Align New Objects to Pixel Grid).

With all of these, anchor points sit on whole pixels and edges become sharp.

Why crispness depends on stroke width

A stroke is centered on the path. A 2 px stroke on a path at a whole-pixel coordinate covers 1 px on each side and fills whole pixels. A 1 px stroke at a whole coordinate covers half a pixel on each side, so it is spread across two pixels and looks gray. For odd widths, place the path at a half-pixel (x.5) coordinate. Filled shapes whose edges sit at whole numbers are always crisp.

Stand-in: crispness checker

Python Stand-in: is this stroke crisp?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Even widths want whole-pixel centers, odd widths want half-pixel centers. Illustrator's pixel grid options handle this for you most of the time.

Keylines

Icon systems (such as Material Design or SF Symbols) use keyline shapes: standard outlines that give every icon the same visual weight. Typical keylines on a 24 px grid:

  • Square: 18 x 18 px
  • Circle: 20 px diameter
  • Portrait rectangle: 16 x 20 px
  • Landscape rectangle: 20 x 16 px

The live area is inset by about 2 px from the edge (padding), leaving a safe margin. Circles are drawn a bit bigger than squares because round shapes look smaller than squares of the same width. Put keylines on a locked, non-printing layer or use them as guides.

Stand-in: keyline fit

Python Stand-in: does the icon fit the live area?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The "wide" icon pokes into the padding, so you would shrink or move it.

Consistency rules

A set looks professional when all icons follow the same rules:

Rule Typical value
Stroke weight 2 px for 24 px icons
Stroke caps and joins Round or square, chosen once
Corner radius One radius (e.g. 2 px) for all rounded rectangles
Gap between parts At least stroke weight
Style Outline OR filled OR duotone, not mixed in one set
Angles Multiples of 15 or 45 degrees

Use Object > Path > Outline Stroke at the end if you must deliver filled shapes, or keep strokes if the developer will style them in code. Use the Round Corners live effect or the Live Corners widget on shapes to keep radii identical.

Drawing tips

  • Use Smart Guides and Align to center parts exactly.
  • Expand only at the end; keep the editable version.
  • Use Pathfinder (see Pathfinder and the Shape Builder) to merge pieces so the icon has few, clean shapes.
  • Put each icon on its own artboard so Export for Screens can export them all at once with the artboard name.
  • Test in Pixel Preview at 100 percent, then at 200 percent (@2x).

Icons for different sizes

A detailed 48 px icon will not shrink well to 16 px. Many systems draw optical sizes: a 16 px version with fewer details and thicker proportional strokes. Provide them when the interface needs very small icons.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A 1 px stroke should sit on which coordinate to render crisply?

    A 1 px stroke is centered on its path, so its edges are at whole pixels only when the path is at x.5.
  2. 2. What do keyline shapes provide?

    Square, circle and rectangle keylines keep a set consistent.
  3. 3. Which view mode shows how artwork will rasterize on screens?

    Pixel Preview (Alt/Option+Ctrl/Cmd+Y) shows the anti-aliased raster result.
  4. 4. Why are circle keylines slightly bigger than square ones?

    Optical balance: round forms need more size to look equal.

Summary

  • Set up a pixel-aligned document with Pixel Preview and Snap to Pixel.
  • Even stroke widths sit on whole pixels, odd ones on half pixels.
  • Keylines and shared rules (weight, radius, style) make a consistent set.
  • The Python checkers are stand-ins for the pixel math.

Next: Pathfinder and the Shape Builder for Logos