pixel snapping web page logo; border:0;

What is Pixel Snapping?

Consider the case of a designer has drawn a series of parallel lines, 2.5 um wide with a gap of 1.8 um between lines. He rasterizes this at 50,800 DPI (a pixel size of 0.5 um).

parallel lines 2.5 um wide with a gap of 1.8 um.

But when he examines his output he sees something like this:

line gap snapped to 2.5 um grid

What has happened? Well since the pixels are spaced on 2.5 um grid points, it is not possible to achieve a 1.8 um gap between lines. The gap must be either 3 pixels (1.5 um) or 4 pixels (2.0 um).


Diagonal Lines

The same occurs with lines that traverse the grid diagonally except that the snapping is apparent in both X and Y. This gives the lines a jagged appearance. Here is what the designer drew in vector space (i.e. GDSII, Gerber, DXF)

diagonal lines on grid

And this is what the bitmap looks like. Again, the reason for the jagged edges and varying width is that each pixel is 0.5 x 0.5 um and snapping occurs.

after pixel snapping

In fact, if these lines were longer, we would see what appear to be shifts in the line spacing and the line width. That's because eventually the edge of each line shifts over 1 pixel but not all edges make the shift at the same time.

There is no algorithm for deciding which pixel to "fire" that will result in smooth and evenly spaced lines. The only solution is to increase the bitmap resolution until the snapping is so small that it is not objectionable.

It is also possible to modulate individual pixels -- usually by varying the energy of the beam used to expose photo-resist. In order to do this, one essentially has to rasterize at a higher DPI and then use those monochrome pixels to define a gray-scale pixel.