In recent years, the internet has developed rapidly. With the popularity of social media, uploading and backing up digital images has become the norm. A huge number of digital images are circulating on the internet daily, and issues related to information security follow. To protect intellectual property rights, digital watermarking is an indispensable technology. However, the common lossy compression technology in the network transmission process is a big problem for watermarking. This paper describes an innovative semi-blind watermarking method with the use of deep convolutional generative adversarial networks (DCGANs) for hiding and extracting watermarks from JPEG-compressed images. The proposed method achieves an average peak signal-to-noise ratio (PSNR) of 49.99 dB, a structural similarity index (SSIM) of 0.95, and a bit error rate (BER) of 0.008 across varying JPEG quality factors. The process is based on an embedder, decoder, generator, and discriminator. It allows watermarking, decoding, or reconstruction to be symmetric such that there is less distortion and durability is improved. It constructs a specific generator for each image and watermark that is supposed to be protected. Experimental results show that, with the variety of JPEG quality factors, the restored watermark achieves a remarkably low corrupted rate, outstripping recent deep learning-based watermarking methods.