A binary defocusing method has a significant impact on improving 3D shape measurement quality for digital fringe projector (DFP) techniques. In this paper, an optimization framework using the dithering method is presented. This framework utilizes genetic algorithm and chaos maps to optimize the bidirectional error-diffusion coefficients. It can effectively avoid quantization errors of binary patterns in a specific direction and obtain the fringe patterns with better symmetry and higher quality. In the process of the optimization, chaos initialization algorithms are used to generate a series of bidirectional error-diffusion coefficients as initial individuals. Additionally, mutation factors generated by chaotic maps, compared with the mutation rate, determine whether the individual position will mutate. Both simulations and experiments demonstrate that the proposed algorithm can improve the quality of phase and reconstruction at different defocus levels.