One of the most significant requirements for a useful watermarking system is strong resistance to a variety of common attacks. Accordingly, the watermark embedding is designed from the attack perspective in this paper. We attempt to develop a new just-noticeable distortion (JND) in the discrete cosine transform (DCT) domain, based on an attack simulation scheme that reversely derives the maximum modification amount embedded in the DCT domain under a condition of imperceptibility. A new location selection approach to watermark embedding is also addressed. We evaluate the fitness of the embedding location by considering the embedding capacity, i.e., the JND of the considered frequency component, in addition to the frequency and the spectral strength, which are usually adopted by the existing methods. Experimental results show satisfactory ability of our method to resist various common attacks such as JPEG compression, smoothing, sharpening, cropping, and noise attacks.