Scanning electron microscopy (SEM) is one of the most prevalent methods used to image and quantify the pore size distribution of shale rock, critical in understanding unconventional petroleum systems and production. Generally, digital greyscale SEM images of shale are currently processed for pore quantification either by a manual drawing method, manual threshold method, automatic threshold method, edge detection or watershed methods, all of which have some limitations that impact the quality of pore extraction results. A new, Edge-Threshold Automatic Processing (ETAP) method is reported here to enable robust extraction and quantification of pore data in shale images. Image pre-treatment makes the greyscale of regions brighter than that of kerogen set to the peak value of kerogen greyscale. The pore image is subsequently obtained using an edge detection method. A discriminant function has been designed to determine the best threshold of the greyscale image to obtain the pore image. Finally, combination of both processed pore images gives the final pore image. Our new method overcomes the impact of kerogen, mineral, roughness and artificial debris caused by pre-treatment of samples, which potentially introduce errors using alternative methods. We compare our new method to a systematic manual drawing method. The processing results through ETAP provide reliable results, and gets the highest value of 0.7466 using a discriminant function Qt, compared with the automatic threshold methods, the edge detection method and watershed method. The application of the ETAP method on shale samples of the Longmaxi Formation and Qiongzhusi Formatiosn in Sichuan basin shows that samples from the Longmaxi Formation have more organic pores than that of the Qiongzhusi Formation, however a larger size of inorganic pores develop in the Qiongzhusi shale. This indicates that shale of the Longmaxi Formation has better reservoir properties and reliable preservation conditions.