We study optical spectral filter synthesis with arrays of piston-actuated micro-mirrors. We propose two algorithms for the calculation of the positions of the micro-mirrors, giving us control of both the amplitude and phase of the synthetic filter. Both algorithms for filter synthesis are explored in an analytic version and in numerical searches for the least deviations between the target and the synthesized filter. We measure the quality of the filter both in terms of the deviations and in filter transmissivity, and present results of numerical simulations for a wide selection of target filters. We find that numerical searches can sometimes yield considerable improvement in the filter synthesis compared to the analytic approximation.