A homogeneous one-dimensional optical lattice is demonstrated by using a high-precision beam shaper based on a digital micromirror device (DMD) with an imaging system containing a pinhole low-pass filter (LPF). This system is capable of producing a high-quality flattop beam profile to form a standing-wave optical lattice with a flattop region. The periodic potential generated by the optical lattice confines ultracold atoms in Bose-Einstein condensate experiments. We conducted beam shaping tests at several wavelengths by implementing various coherent and incoherent light sources in the visible and infrared wavelength ranges. Experiments produced flattop and other well-controlled beam profiles with 0.2% to 0.26% root-mean-square (RMS) error after applying a digital LPF and nearly flat phase. Several concerns for the system design are presented. First, the energy requirement was determined by power conversion analysis and DMD diffraction efficiency simulation. In addition, a LabVIEW program was written to accelerate the speed of the iterative process for beam profile refinement. Finally, various camera calibrations improved the measurement accuracy. We achieved a 1.25% RMS error flattop beam with diameter of 70.4 μm at the atoms’ plane. Other beam profile measurements in different diagnostic planes demonstrated a good intensity uniformity of the optical lattice.