Seismic waves traveling in the earth experience amplitude loss and velocity dispersion associated with strong subsurface attenuation. To compensate for these effects, the Q model should be first estimated and the data can be corrected. However, Q estimation from the data can be challenging if the data have a poor signal-to-noise ratio. To mitigate this problem, we develop a wave-equation Q inversion method in the image domain. This method seeks a Q model which minimizes the local wavenumber differences between a reference image without Q effects, and a Q migration image computed with the current Q model. Numerical tests on synthetic data demonstrate that the Q model inverted by this image-domain Q inversion method can lead to a noticeable improvement in the migration image quality.