Digital watermarking has been proposed as a way to claim the ownership of the source and owner of the digital image data. In this paper, A robust algorithm based on DCT region is proposed to improve the image security. The main transforming is based on DCT (Discrete Cosine Transform). The algorithm was processed in the MATLAB software. In this paper, images of gray scale and RGB color scale were researched respectively. For color images, in order to get the best image quality, the RGB scale was transformed to YcbCr scale. Then, the Y channel (brightness channel) was separated, in which the watermark was embedded and extracted. The results show that the algorithm embedded a certain size of black and white Bitmap image into gray and color images. The watermark can’t be seen by the naked eye. The robustness detection experiment was also carried out. The watermark can still be extracted after certain amount of tailoring, defacing, Gaussian noise, and format changes. The similarity is more than 0.7. It confirmed that the algorithm is highly robust.