An element-specific coherent x-ray imaging technique using anomalous x-ray scattering in the hard x-ray region was first demonstrated. Coherent x-ray diffraction patterns of a sample composed of 500-nm-thick Ni and Cu layers were measured at incident x-ray energies around the $\text{Ni}\text{ }K$ absorption edge. Non-center-symmetric diffraction patterns due to anomalous scattering phenomenon in the hard x-ray region were observed. Symmetricity of the diffraction pattern was quantitatively analyzed by numerically simulating the x-ray wave field behind the sample position using the Rytov approximation. By calculating the difference between the intensities of reconstructed images of different energies, an image of the Ni layers could be derived although it was not enough to identify precisely. This method is widely applicable to nondestructive analysis of nanometer-scale elemental distribution of materials buried within thick and high-$Z$ samples.