A confocal imaging system utilizes an opaque mask with a slit and a row of pinpoint sensors or utilizes an opaque mask with a skewed pattern of pinholes and an array of isolated pinpoint sensors in a matching pattern in order to obtain sufficient data to provide a complete image for imaging and/or inspecting an object such as electronics in a single one-dimensional scan. The system also simultaneously produces multiple images at different heights in the single one-dimensional scan of the viewed object, and also simultaneously produces images taken in different spectral bands in the same one-dimensional scan of the object to be imaged and/or inspected. The relative height or depth of the different images can be modified by simply adjusting the inclination between the confocal imaging system and a path followed by the object that is to be imaged and/or inspected during the one-dimensional scan. The optical confocal imaging system requires no moving parts and the only moving parts of the system are for motorized conveying of the object to be imaged and/or inspected along the path. In one arrangement of the confocal imaging system, color imaging and/or inspecting of the object can be performed. In another arrangement of the confocal imaging system, simultaneous brightfield and darkfield imaging and/or inspecting of an object can be performed.