In order to resist print and scan attacks, a kind of digital halftone image watermarking algorithm is proposed, which is based on the edge detection and improved error diffusion. The edge of gray image is gotten using canny detection. Calculate the noise visibility function values of the edge points. Then, sort the values in ascending order and select the size that equal to the length of watermark as the location of watermark embedding. While the grayscale image turns to halftone image using the improved error diffusion algorithm, binary watermark is embedded in the edge position. Watermark is pretreated with Arnold before embedding to improve the safety of watermark. Experiment results show that the algorithm is good resistance to print and scan attacks, while resistance to shearing, noise and jpeg compression attacks.