An approach to dividing the printed circuit board into parts to increase visibility of defects in a PCB image is considered. The approach is based on a piecewise linear approximation of a cumulative histogram. The last one is calculated for numbers of informative pixels placed in rows and columns of an image matrix. Informative pixels are those indicating contacts and C traces. The histogram demonstrates a distribution of informative pixels along the OX and OY axes. The beginning and ending points of linear lines are taken as coordinates of the divided parts of the PCB board. The flood-fill algorithm is used to color and separate the PCB chains components. The start pixels are taken from a set of informative pixels. To measure defect values, a mean intensity and gradient functions for the template and manufactured images are used. Distributed cumulative histograms are applied to PCB components to detect places and intensity of defects.