Digital watermarking has been widely used in copyright protection for digital images, but most of the watermarking algorithm can't resist print-and-scan process. Print-and-scan attack is a challenging problem for most of digital watermarks. A watermarking algorithm against print-and-scan attack based on PSO (Particle Swarm Optimization) is proposed in this paper. The watermark information is embedded in a halftone process for image screening with phase modulation method. The watermark is extracted by a template, which is optimized using the PSO algorithm. Both mean filtering and median filtering are used to remove noise from the recovered watermark image. The experimental results show the halftone watermarking algorithm optimized using PSO has better performance, it is robust under smearing attack and cropping attack, and has good resistance to print-and-scan process. It can be applied in the field of anti-counterfeit printing.