A school for how screens render designLesson 00 / The pixelYour panel 0 × 0 device px
Subpixel

What happensinside a pixel.

Every line you draw ends up as a grid of tiny lights. SUBPIXEL teaches designers what the screen does with their work: anti-aliasing, subpixels, hinting, half pixels and density, so you can design for the pixels you actually get.

Magnification ×1.0Scroll to zoom into the letter aDrag the loupe anywhere
02 / The half pixelPinned / scroll to snap the line

The half pixel.

Here is a 1px line, drawn at left: 4.5px. Pixels have no halves, so the dashed guides show where the real boundaries are.

The line covers half of column 4 and half of column 5. Both light at 50%. One sharp line becomes two grey ones: twice as wide, half as bright.

Snap to the pixel. At left: 4px the line fills column 4 exactly. One pixel, fully lit, full contrast. Round your coordinates, not your hopes.

.rule {
  left: 4.5px;4px;
  width: 1px;
}
Column 40%
Column 50%
Edge contrast0%
1px line
State Blurry
03 / Device pixel ratioLayout animates with Flip

One icon. Three densities.

You design a 16px icon. A 1x screen draws it with 16 × 16 lights. A 2x phone uses 32 × 32 and a 3x phone 48 × 48. Same size on the glass, very different amounts of detail. Curves only look smooth when there are pixels to spend on them.

Your screen 1x
1x16 × 16 device px
1 css px = 1 device px
2x32 × 32 device px
1 css px = 2 × 2 device px
3x48 × 48 device px
1 css px = 3 × 3 device px

Why 1px borders look different on retina.

On a 2x screen a 1px border is two device pixels thick. Type and icons got sharper, the border did not get thinner, so it reads heavy. That is why native apps use 0.5px hairlines on dense screens. On a 1x screen half a pixel does not exist and becomes a grey smear.

04 / CurriculumHover or tap a lesson to switch its render

Eight lessons. All of them pixels.

05 / PracticeTwo tools, both real

Stop guessing. Rasterise it.