The goal of this presentation is to understand and quantify the attenuation effects in the subsurface and to create an accurate laterally- and vertically- varying quality factor (Q) model for gas clouds/pockets. Such Q models are used in seismic migration to improve the image quality. Current Q model building performed in data space using ray-based tomography has limitations to produce reliable models. This presentation presents an inversion-based method, wave-equation migration Q analysis (WEMQA), with two major features. First, this method is performed in the image space to reduce noise, focus events, and provide a direct link between Q model perturbations and image perturbations. Second, this method employs wave-equation-based Q tomography to handle the complex wave propagation. The numerical application of WEMQA to the numerical model with Q anomalies demonstrates its feasibility on characterizing Q anomalies, and as consequence, improves the seismic image.