Reverse time migration (RTM) is implemented by solving the two-way wave equation using recorded data as boundary conditions. The full wave equation can simulate wave propagation in all directions; thus, RTM has no dip limitations and is capable of imaging complex structures. Because wavefields are allowed to travel in all directions, the source and receiver wavefields can be scattered back from strong velocity contrasts. The crosscorrelation of head waves, diving waves, and backscattered waves along a raypath can lead to strong artifacts in the RTM image. These artifacts degrade the final image quality. An inversion-based imaging condition that computes the weighted sum of a time derivative image and a spatial gradient image can significantly reduce the RTM artifacts. Based on the multiscale directional selectivity property of the wavelet transform, we have developed a new method to compute the weighting function for the inversion-based imaging condition in the wavelet domain. The unique property of this approach is that the weighting function depends on the spatial locations, wavenumber, and local directions. This multidimensional property allows us to selectively remove the RTM image artifacts while preserving useful energy. We determine the effectiveness of our method for attenuating RTM artifacts using synthetic examples.