Whole slide imaging (WSI) systems convert the conventional biological samples into digital images. Existing commercial WSI systems usually require an expensive high-performance motorized stage to implement the precise mechanical control, and the cost is prohibitive for most individual pathologists. In this work, we report a low-cost WSI system using the off-the-shelf components, including a computer numerical control (CNC) router, a photographic lens, a programmable LED array, a fluorescence filter cube, and a surface-mount LED. To perform real-time single-frame autofocusing, we exploited two elements of a programmable LED array to illuminate the sample from two different incident angles. The captured image would contain two copies of the sample with a certain separation determined by the defocus distance of the sample. Then the defocus distance can be recovered by identifying the translational shift of the two copies. The reported WSI system can reach a resolution of ∼0.7 µm. The time to determine the optimal focusing position for each tile is only 0.02 s, which is about an 83% improvement compared to our previous work. We quantified the focusing performance on 1890 different tissue tiles. The mean focusing error is ∼0.34 µm, which is well below the ± 0.7 µm depth of field range of our WSI system. The reported WSI system can handle both the semitransparent and the transparent sample, enabling us to demonstrate the implementation of brightfield, fluorescence, and phase-contrast WSI. An automatic digital distortion correction strategy is also developed to avoid the stitching errors. The reported prototype has an affordable cost and can make it broadly available and utilizable for individual pathologists as well as can promote the development of digital pathology.