The protocol describes procedures to acquire high-spatial resolution computed tomography (CT) images of a granular soil during triaxial compression, and to apply image processing techniques to these CT images to explore the grain-scale mechanical behavior of the soil under loading.