Two algorithms for visual inspection of printed-circuit boards are presented that perform width checking of conductors and insulators. The first detects the difference between the results of shrinking and connectivity-preserving shrinking (CPS). The second algorithm produces a difference between the original and the shrunk picture. This result is subject to a number of CPS-operations after which errors are easily detected. Both algorithms can be adapted to a suitable level of sensitivity to sharp corners and edge irregularities. A sequential version of CPS is also described which is well suited for hardware implementation in a pipelined structure.<>